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