Module org.eclipse.persistence.core
Class MethodAttributeAccessor
java.lang.Object
org.eclipse.persistence.mappings.AttributeAccessor
org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreAttributeAccessor
- Direct Known Subclasses:
JAXBSetMethodAttributeAccessor
,SDOMethodAttributeAccessor
,VirtualAttributeAccessor
Purpose: A wrapper class for handling cases when the domain object attributes are to be accessed thru the accessor methods. This could happen if the variables are not defined public in the domain object.
- Since:
- TOPLink/Java 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Method
protected String
protected Method
protected String
Fields inherited from class org.eclipse.persistence.mappings.AttributeAccessor
attributeName, isReadOnly, isWriteOnly
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass
<?> Return the return type of the method accessor.getAttributeValueFromObject
(Object anObject) Gets the value of an instance variable in the object.protected Object
getAttributeValueFromObject
(Object anObject, Object[] parameters) Gets the value of an instance variable in the object.Return the accessor method for the attribute accessor.Return the name of the accessor method for the attribute accessor.Class
<?> INTERNAL: Return the GetMethod return type for this MethodAttributeAccessor.protected Method
Return the set method for the attribute accessor.Return the name of the set method for the attribute accessor.Class
<?> protected Class
<?> getSetMethodParameterType
(int index) protected Class<?>[]
void
initializeAttributes
(Class<?> theJavaClass) Set get and set method after creating these methods by using get and set method namesprotected void
initializeAttributes
(Class<?> theJavaClass, Class<?>[] getParameterTypes) Set get and set method after creating these methods by using get and set method namesboolean
Returns true if this attribute accessor has been initialized and now stores a reference to the class's attribute.boolean
void
setAttributeValueInObject
(Object domainObject, Object attributeValue) Sets the value of the instance variable in the object to the value.protected void
setAttributeValueInObject
(Object domainObject, Object attributeValue, Object[] parameters) Sets the value of the instance variable in the object to the value.protected void
setGetMethod
(Method getMethod) Set the accessor method for the attribute accessor.void
setGetMethodName
(String getMethodName) Set the name of the accessor method for the attribute accessor.protected void
setSetMethod
(Method setMethod) Set the set method for the attribute accessor.void
setSetMethodName
(String setMethodName) Set the name of the set method for the attribute accessor.Methods inherited from class org.eclipse.persistence.mappings.AttributeAccessor
clone, getAttributeName, isInstanceVariableAttributeAccessor, isMapValueAttributeAccessor, isReadOnly, isValuesAccessor, isVirtualAttributeAccessor, isWriteOnly, setAttributeName, setIsReadOnly, setIsWriteOnly
-
Field Details
-
setMethodName
-
getMethodName
-
setMethod
-
getMethod
-
-
Constructor Details
-
MethodAttributeAccessor
public MethodAttributeAccessor()
-
-
Method Details
-
getAttributeClass
Return the return type of the method accessor.- Specified by:
getAttributeClass
in interfaceCoreAttributeAccessor
- Overrides:
getAttributeClass
in classAttributeAccessor
-
getAttributeValueFromObject
Gets the value of an instance variable in the object.- Specified by:
getAttributeValueFromObject
in interfaceCoreAttributeAccessor
- Specified by:
getAttributeValueFromObject
in classAttributeAccessor
- Throws:
DescriptorException
-
getAttributeValueFromObject
protected Object getAttributeValueFromObject(Object anObject, Object[] parameters) throws DescriptorException Gets the value of an instance variable in the object.- Throws:
DescriptorException
-
getGetMethod
Return the accessor method for the attribute accessor. 266912: For Metamodel API - change visibility from protected -
getGetMethodName
Return the name of the accessor method for the attribute accessor. -
getGetMethodReturnType
INTERNAL: Return the GetMethod return type for this MethodAttributeAccessor. A special check is made to determine if a missing method is a result of failed weaving.- Throws:
DescriptorException
-
getSetMethod
Return the set method for the attribute accessor. -
getSetMethodName
Return the name of the set method for the attribute accessor. -
getSetMethodParameterType
-
getSetMethodParameterType
-
getSetMethodParameterTypes
-
initializeAttributes
Set get and set method after creating these methods by using get and set method names- Specified by:
initializeAttributes
in interfaceCoreAttributeAccessor
- Overrides:
initializeAttributes
in classAttributeAccessor
- Throws:
DescriptorException
-
initializeAttributes
protected void initializeAttributes(Class<?> theJavaClass, Class<?>[] getParameterTypes) throws DescriptorException Set get and set method after creating these methods by using get and set method names- 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
-
isMethodAttributeAccessor
public boolean isMethodAttributeAccessor()- Specified by:
isMethodAttributeAccessor
in interfaceCoreAttributeAccessor
- Overrides:
isMethodAttributeAccessor
in classAttributeAccessor
-
setAttributeValueInObject
public void setAttributeValueInObject(Object domainObject, Object attributeValue) 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
-
setAttributeValueInObject
protected void setAttributeValueInObject(Object domainObject, Object attributeValue, Object[] parameters) throws DescriptorException Sets the value of the instance variable in the object to the value.- Throws:
DescriptorException
-
setGetMethod
Set the accessor method for the attribute accessor. -
setGetMethodName
Set the name of the accessor method for the attribute accessor. -
setSetMethod
Set the set method for the attribute accessor. -
setSetMethodName
Set the name of the set method for the attribute accessor.
-