public class InstanceVariableAttributeAccessor extends AttributeAccessor
Purpose: A wrapper class for handling cases when the domain object has instance varible to map to the database field.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.reflect.Field |
attributeField
The attribute name of an object is converted to Field type to access it reflectively
|
attributeName| Constructor and Description |
|---|
InstanceVariableAttributeAccessor() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Class |
getAttributeClass()
Returns the class type of the attribute.
|
protected java.lang.reflect.Field |
getAttributeField()
Returns the value of attributeField.
|
java.lang.Class |
getAttributeType()
Returns the declared type of attributeField.
|
java.lang.Object |
getAttributeValueFromObject(java.lang.Object anObject)
Returns the value of the attribute on the specified object.
|
void |
initializeAttributes(java.lang.Class theJavaClass)
instanceVariableName is converted to Field type.
|
protected void |
setAttributeField(java.lang.reflect.Field field)
Sets the value of the attributeField.
|
void |
setAttributeValueInObject(java.lang.Object anObject,
java.lang.Object value)
Sets the value of the instance variable in the object to the value.
|
clone, getAttributeName, setAttributeNameprotected transient java.lang.reflect.Field attributeField
public java.lang.Class getAttributeClass()
getAttributeClass in class AttributeAccessorprotected java.lang.reflect.Field getAttributeField()
public java.lang.Class getAttributeType()
public java.lang.Object getAttributeValueFromObject(java.lang.Object anObject)
throws DescriptorException
getAttributeValueFromObject in class AttributeAccessorDescriptorExceptionpublic void initializeAttributes(java.lang.Class theJavaClass)
throws DescriptorException
initializeAttributes in class AttributeAccessorDescriptorExceptionprotected void setAttributeField(java.lang.reflect.Field field)
public void setAttributeValueInObject(java.lang.Object anObject,
java.lang.Object value)
throws DescriptorException
setAttributeValueInObject in class AttributeAccessorDescriptorException