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 Field
attributeField
The 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.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.boolean
isInitialized()
Returns true if this attribute accessor has been initialized and now stores a reference to the class's attribute.boolean
isInstanceVariableAttributeAccessor()
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.-
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:
getAttributeClass
in interfaceCoreAttributeAccessor
- Overrides:
getAttributeClass
in 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:
getAttributeValueFromObject
in interfaceCoreAttributeAccessor
- Specified by:
getAttributeValueFromObject
in classAttributeAccessor
- Throws:
DescriptorException
-
initializeAttributes
public void initializeAttributes(Class theJavaClass) throws DescriptorException
instanceVariableName is converted to Field type.- Specified by:
initializeAttributes
in interfaceCoreAttributeAccessor
- Overrides:
initializeAttributes
in 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:
isInitialized
in classAttributeAccessor
-
isInstanceVariableAttributeAccessor
public boolean isInstanceVariableAttributeAccessor()
- Specified by:
isInstanceVariableAttributeAccessor
in interfaceCoreAttributeAccessor
- Overrides:
isInstanceVariableAttributeAccessor
in 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:
setAttributeValueInObject
in interfaceCoreAttributeAccessor
- Specified by:
setAttributeValueInObject
in classAttributeAccessor
- Throws:
DescriptorException
-
-