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
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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FieldThe attribute name of an object is converted to Field type to access it reflectivelyFields inherited from class org.eclipse.persistence.mappings.AttributeAccessor
attributeName, isReadOnly, isWriteOnly -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?> Returns the class type of the attribute.Returns the value of attributeField.Class<?> Returns the declared type of attributeField.getAttributeValueFromObject(Object anObject) Returns the value of the attribute on the specified object.voidinitializeAttributes(Class<?> theJavaClass) instanceVariableName is converted to Field type.booleanReturns true if this attribute accessor has been initialized and now stores a reference to the class's attribute.booleanprotected 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 Details
-
attributeField
The attribute name of an object is converted to Field type to access it reflectively
-
-
Constructor Details
-
InstanceVariableAttributeAccessor
public InstanceVariableAttributeAccessor()
-
-
Method Details
-
getAttributeClass
Returns the class type of the attribute.- Specified by:
getAttributeClassin interfaceCoreAttributeAccessor- Overrides:
getAttributeClassin classAttributeAccessor
-
getAttributeField
Returns the value of attributeField. 266912: For Metamodel API - change visibility from protected -
getAttributeType
Returns the declared type of attributeField. -
getAttributeValueFromObject
Returns the value of the attribute on the specified object.- Specified by:
getAttributeValueFromObjectin interfaceCoreAttributeAccessor- Specified by:
getAttributeValueFromObjectin classAttributeAccessor- Throws:
DescriptorException
-
initializeAttributes
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
Sets the value of the attributeField. -
setAttributeValueInObject
Sets the value of the instance variable in the object to the value.- Specified by:
setAttributeValueInObjectin interfaceCoreAttributeAccessor- Specified by:
setAttributeValueInObjectin classAttributeAccessor- Throws:
DescriptorException
-