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 Methodprotected Stringprotected Methodprotected StringFields 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 ObjectgetAttributeValueFromObject(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 MethodReturn 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<?>[]voidinitializeAttributes(Class<?> theJavaClass) Set get and set method after creating these methods by using get and set method namesprotected voidinitializeAttributes(Class<?> theJavaClass, Class<?>[] getParameterTypes) Set get and set method after creating these methods by using get and set method namesbooleanReturns true if this attribute accessor has been initialized and now stores a reference to the class's attribute.booleanvoidsetAttributeValueInObject(Object domainObject, Object attributeValue) Sets the value of the instance variable in the object to the value.protected voidsetAttributeValueInObject(Object domainObject, Object attributeValue, Object[] parameters) Sets the value of the instance variable in the object to the value.protected voidsetGetMethod(Method getMethod) Set the accessor method for the attribute accessor.voidsetGetMethodName(String getMethodName) Set the name of the accessor method for the attribute accessor.protected voidsetSetMethod(Method setMethod) Set the set method for the attribute accessor.voidsetSetMethodName(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:
getAttributeClassin interfaceCoreAttributeAccessor- Overrides:
getAttributeClassin classAttributeAccessor
-
getAttributeValueFromObject
Gets the value of an instance variable in the object.- Specified by:
getAttributeValueFromObjectin interfaceCoreAttributeAccessor- Specified by:
getAttributeValueFromObjectin 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:
initializeAttributesin interfaceCoreAttributeAccessor- Overrides:
initializeAttributesin 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:
isInitializedin classAttributeAccessor
-
isMethodAttributeAccessor
public boolean isMethodAttributeAccessor()- Specified by:
isMethodAttributeAccessorin interfaceCoreAttributeAccessor- Overrides:
isMethodAttributeAccessorin 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:
setAttributeValueInObjectin interfaceCoreAttributeAccessor- Specified by:
setAttributeValueInObjectin 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.
-