Module org.eclipse.persistence.core
Class InstanceVariableAttributeAccessor
- java.lang.Object
-
- org.eclipse.persistence.mappings.AttributeAccessor
-
- org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor
-
- All Implemented Interfaces:
Serializable,Cloneable,CoreAttributeAccessor
- Direct Known Subclasses:
PersistenceObjectAttributeAccessor
public class InstanceVariableAttributeAccessor extends AttributeAccessor
Purpose: A wrapper class for handling cases when the domain object has instance variable to map to the database field.
- Since:
- TOPLink/Java 1.0
- Author:
- Sati
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FieldattributeFieldThe attribute name of an object is converted to Field type to access it reflectively-
Fields inherited from class org.eclipse.persistence.mappings.AttributeAccessor
attributeName, isReadOnly, isWriteOnly
-
-
Constructor Summary
Constructors Constructor Description InstanceVariableAttributeAccessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>getAttributeClass()Returns the class type of the attribute.FieldgetAttributeField()Returns the value of attributeField.Class<?>getAttributeType()Returns the declared type of attributeField.ObjectgetAttributeValueFromObject(Object anObject)Returns the value of the attribute on the specified object.voidinitializeAttributes(Class<?> theJavaClass)instanceVariableName is converted to Field type.booleanisInitialized()Returns true if this attribute accessor has been initialized and now stores a reference to the class's attribute.booleanisInstanceVariableAttributeAccessor()protected voidsetAttributeField(Field field)Sets the value of the attributeField.voidsetAttributeValueInObject(Object anObject, Object value)Sets the value of the instance variable in the object to the value.-
Methods inherited from class org.eclipse.persistence.mappings.AttributeAccessor
clone, getAttributeName, isMapValueAttributeAccessor, isMethodAttributeAccessor, isReadOnly, isValuesAccessor, isVirtualAttributeAccessor, isWriteOnly, setAttributeName, setIsReadOnly, setIsWriteOnly
-
-
-
-
Field Detail
-
attributeField
protected transient Field attributeField
The attribute name of an object is converted to Field type to access it reflectively
-
-
Method Detail
-
getAttributeClass
public Class<?> getAttributeClass()
Returns the class type of the attribute.- Specified by:
getAttributeClassin interfaceCoreAttributeAccessor- Overrides:
getAttributeClassin classAttributeAccessor
-
getAttributeField
public Field getAttributeField()
Returns the value of attributeField. 266912: For Metamodel API - change visibility from protected
-
getAttributeType
public Class<?> getAttributeType()
Returns the declared type of attributeField.
-
getAttributeValueFromObject
public Object getAttributeValueFromObject(Object anObject) throws DescriptorException
Returns the value of the attribute on the specified object.- Specified by:
getAttributeValueFromObjectin interfaceCoreAttributeAccessor- Specified by:
getAttributeValueFromObjectin classAttributeAccessor- Throws:
DescriptorException
-
initializeAttributes
public void initializeAttributes(Class<?> theJavaClass) throws DescriptorException
instanceVariableName is converted to Field type.- Specified by:
initializeAttributesin interfaceCoreAttributeAccessor- Overrides:
initializeAttributesin classAttributeAccessor- Throws:
DescriptorException
-
isInitialized
public boolean isInitialized()
Returns true if this attribute accessor has been initialized and now stores a reference to the class's attribute. An attribute accessor can become uninitialized on serialization.- Overrides:
isInitializedin classAttributeAccessor
-
isInstanceVariableAttributeAccessor
public boolean isInstanceVariableAttributeAccessor()
- Specified by:
isInstanceVariableAttributeAccessorin interfaceCoreAttributeAccessor- Overrides:
isInstanceVariableAttributeAccessorin classAttributeAccessor
-
setAttributeField
protected void setAttributeField(Field field)
Sets the value of the attributeField.
-
setAttributeValueInObject
public void setAttributeValueInObject(Object anObject, Object value) throws DescriptorException
Sets the value of the instance variable in the object to the value.- Specified by:
setAttributeValueInObjectin interfaceCoreAttributeAccessor- Specified by:
setAttributeValueInObjectin classAttributeAccessor- Throws:
DescriptorException
-
-