1 16 package net.sf.dozer.util.mapping.propertydescriptor; 17 18 import java.lang.reflect.Method ; 19 20 import net.sf.dozer.util.mapping.MappingException; 21 import net.sf.dozer.util.mapping.fieldmap.ClassMap; 22 import net.sf.dozer.util.mapping.fieldmap.Hint; 23 import net.sf.dozer.util.mapping.util.MapperConstants; 24 25 28 public class SelfPropertyDescriptor implements DozerPropertyDescriptorIF { 29 30 private final Class self; 31 32 public SelfPropertyDescriptor(Class self) { 33 this.self = self; 34 } 35 36 public Class getPropertyType(Class clazz) throws MappingException { 37 return self; 38 } 39 40 public void setPropertyValue(Object bean, Object value, Hint hint, ClassMap classMap) throws MappingException { 41 } 43 44 public Object getPropertyValue(Object bean) throws MappingException { 45 return bean; 46 } 47 48 public String getReadMethodName(Class clazz) { 49 return MapperConstants.SELF_KEYWORD; 50 } 51 52 public String getWriteMethodName(Class clazz) { 53 return MapperConstants.SELF_KEYWORD; 54 } 55 56 public Method getReadMethod(Class clazz) { 57 throw new UnsupportedOperationException (); 58 } 59 60 public Method getWriteMethod(Class clazz) { 61 throw new UnsupportedOperationException (); 62 } 63 64 } 65 | Popular Tags |