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 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 |
---|---|
Class |
getAttributeClass()
Returns the class type of the attribute.
|
protected Field |
getAttributeField()
Returns the value of attributeField.
|
Class |
getAttributeType()
Returns the declared type of attributeField.
|
Object |
getAttributeValueFromObject(Object anObject)
Returns the value of the attribute on the specified object.
|
void |
initializeAttributes(Class theJavaClass)
instanceVariableName is converted to Field type.
|
protected void |
setAttributeField(Field field)
Sets the value of the attributeField.
|
void |
setAttributeValueInObject(Object anObject,
Object value)
Sets the value of the instance variable in the object to the value.
|
clone, getAttributeName, setAttributeName
protected transient Field attributeField
public Class getAttributeClass()
getAttributeClass
in class AttributeAccessor
protected Field getAttributeField()
public Class getAttributeType()
public Object getAttributeValueFromObject(Object anObject) throws DescriptorException
getAttributeValueFromObject
in class AttributeAccessor
DescriptorException
public void initializeAttributes(Class theJavaClass) throws DescriptorException
initializeAttributes
in class AttributeAccessor
DescriptorException
protected void setAttributeField(Field field)
public void setAttributeValueInObject(Object anObject, Object value) throws DescriptorException
setAttributeValueInObject
in class AttributeAccessor
DescriptorException
Copyright © 2022. All rights reserved.