Class InstanceVariableAttributeAccessor
- java.lang.Object
-
- org.eclipse.persistence.mappings.AttributeAccessor
-
- org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.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 java.lang.reflect.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 java.lang.ClassgetAttributeClass()Returns the class type of the attribute.java.lang.reflect.FieldgetAttributeField()Returns the value of attributeField.java.lang.ClassgetAttributeType()Returns the declared type of attributeField.java.lang.ObjectgetAttributeValueFromObject(java.lang.Object anObject)Returns the value of the attribute on the specified object.voidinitializeAttributes(java.lang.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(java.lang.reflect.Field field)Sets the value of the attributeField.voidsetAttributeValueInObject(java.lang.Object anObject, java.lang.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
-
-
-
-
Method Detail
-
getAttributeClass
public java.lang.Class getAttributeClass()
Returns the class type of the attribute.- Specified by:
getAttributeClassin interfaceCoreAttributeAccessor- Overrides:
getAttributeClassin classAttributeAccessor
-
getAttributeField
public java.lang.reflect.Field getAttributeField()
Returns the value of attributeField. 266912: For Metamodel API - change visibility from protected
-
getAttributeType
public java.lang.Class getAttributeType()
Returns the declared type of attributeField.
-
getAttributeValueFromObject
public java.lang.Object getAttributeValueFromObject(java.lang.Object anObject) throws DescriptorExceptionReturns the value of the attribute on the specified object.- Specified by:
getAttributeValueFromObjectin interfaceCoreAttributeAccessor- Specified by:
getAttributeValueFromObjectin classAttributeAccessor- Throws:
DescriptorException
-
initializeAttributes
public void initializeAttributes(java.lang.Class theJavaClass) throws DescriptorExceptioninstanceVariableName 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(java.lang.reflect.Field field)
Sets the value of the attributeField.
-
setAttributeValueInObject
public void setAttributeValueInObject(java.lang.Object anObject, java.lang.Object value) throws DescriptorExceptionSets the value of the instance variable in the object to the value.- Specified by:
setAttributeValueInObjectin interfaceCoreAttributeAccessor- Specified by:
setAttributeValueInObjectin classAttributeAccessor- Throws:
DescriptorException
-
-