1 16 package net.sf.dozer.util.mapping.converters; 17 18 import net.sf.dozer.util.mapping.vo.HintedOnly; 19 20 import org.apache.commons.logging.Log; 21 import org.apache.commons.logging.LogFactory; 22 23 26 public class HintedOnlyConverter implements CustomConverter { 27 28 private static final Log log = LogFactory.getLog(HintedOnlyConverter.class); 29 30 public Object convert(Object destination, Object source, Class destClass, Class sourceClass) { 31 log.debug("Source Class is:" + sourceClass.getName()); 32 log.debug("Dest Class is:" + destClass.getName()); 33 if (source != null) { 34 log.debug("Source Obj is:" + source.getClass().getName()); 35 } 36 if (destination != null) { 37 log.debug("Dest Obj is:" + destination.getClass().getName()); 38 } 39 if (source instanceof HintedOnly) { 40 return ((HintedOnly) source).getStr(); 41 } 42 43 HintedOnly hint; 44 if (destination == null) { 45 hint = new HintedOnly(); 46 } else { 47 hint = (HintedOnly) destination; 48 } 49 hint.setStr((String ) source); 50 return hint; 51 } 52 } | Popular Tags |