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