1 21 package oracle.toplink.essentials.mappings; 23 24 import java.io.*; 25 import oracle.toplink.essentials.exceptions.*; 26 import oracle.toplink.essentials.internal.helper.ClassConstants; 27 28 37 public abstract class AttributeAccessor implements Cloneable , Serializable { 38 39 40 protected String attributeName; 41 42 46 public Object clone() { 47 try { 48 return super.clone(); 49 } catch (CloneNotSupportedException e) { 50 throw new InternalError (); 51 } 52 } 53 54 58 public String getAttributeName() { 59 return attributeName; 60 } 61 62 66 public void setAttributeName(String attributeName) { 67 this.attributeName = attributeName; 68 } 69 70 73 public Class getAttributeClass() { 74 return ClassConstants.OBJECT; 75 } 76 77 80 public void initializeAttributes(Class descriptorClass) throws DescriptorException { 81 if (getAttributeName() == null) { 82 throw DescriptorException.attributeNameNotSpecified(); 83 } 84 } 85 86 89 public abstract Object getAttributeValueFromObject(Object object) throws DescriptorException; 90 91 94 public abstract void setAttributeValueInObject(Object object, Object value) throws DescriptorException; 95 } 96 | Popular Tags |