public class MethodAttributeAccessor extends AttributeAccessor
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.
Modifier and Type | Field and Description |
---|---|
protected Method |
getMethod |
protected String |
getMethodName |
protected Method |
setMethod |
protected String |
setMethodName |
attributeName
Constructor and Description |
---|
MethodAttributeAccessor() |
Modifier and Type | Method and Description |
---|---|
Class |
getAttributeClass()
Return the return type of the method accessor.
|
Object |
getAttributeValueFromObject(Object anObject)
Gets the value of an instance variable in the object.
|
protected Method |
getGetMethod()
Return the accessor method for the attribute accessor.
|
String |
getGetMethodName()
Return the name of theh accessor method for the attribute accessor.
|
Class |
getGetMethodReturnType() |
protected Method |
getSetMethod()
Return the set method for the attribute accessor.
|
String |
getSetMethodName()
Return the name of the set method for the attribute accessor.
|
Class |
getSetMethodParameterType() |
void |
initializeAttributes(Class theJavaClass)
Set get and set method after creating these methods by using
get and set method names
|
boolean |
isMethodAttributeAccessor() |
void |
setAttributeValueInObject(Object domainObject,
Object attributeValue)
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.
|
clone, getAttributeName, setAttributeName
protected String setMethodName
protected String getMethodName
protected transient Method setMethod
protected transient Method getMethod
public Class getAttributeClass()
getAttributeClass
in class AttributeAccessor
public Object getAttributeValueFromObject(Object anObject) throws DescriptorException
getAttributeValueFromObject
in class AttributeAccessor
DescriptorException
protected Method getGetMethod()
public String getGetMethodName()
public Class getGetMethodReturnType()
protected Method getSetMethod()
public String getSetMethodName()
public Class getSetMethodParameterType()
public void initializeAttributes(Class theJavaClass) throws DescriptorException
initializeAttributes
in class AttributeAccessor
DescriptorException
public boolean isMethodAttributeAccessor()
public void setAttributeValueInObject(Object domainObject, Object attributeValue) throws DescriptorException
setAttributeValueInObject
in class AttributeAccessor
DescriptorException
protected void setGetMethod(Method getMethod)
public void setGetMethodName(String getMethodName)
protected void setSetMethod(Method setMethod)
public void setSetMethodName(String setMethodName)
Copyright © 2023. All rights reserved.