net.sf.mmm.util.pojo.descriptor.base.accessor
Class AbstractPojoPropertyAccessorMethod

java.lang.Object
  extended by net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessor
      extended by net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorBase
          extended by net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorMethod
All Implemented Interfaces:
PojoPropertyAccessor, PojoAttributeName
Direct Known Subclasses:
PojoPropertyAccessorIndexedNonArgMethod, PojoPropertyAccessorIndexedOneArgMethod, PojoPropertyAccessorNonArgMethod, PojoPropertyAccessorOneArgMethod, PojoPropertyAccessorTwoArgMethod

public abstract class AbstractPojoPropertyAccessorMethod
extends AbstractPojoPropertyAccessorBase

This is the abstract implementation of the PojoPropertyAccessor interface used to access a Method.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  Method method
           
private  GenericType<?> returnType
           
 
Constructor Summary
AbstractPojoPropertyAccessorMethod(String propertyName, Type propertyType, PojoDescriptor<?> descriptor, PojoDescriptorDependencies dependencies, Method method)
          The constructor.
 
Method Summary
 AccessibleObject getAccessibleObject()
          This method gets the accessible object used to access (read/write) this property.
 Class<?> getDeclaringClass()
          This method gets the class reflecting the type that declared this accessor.
protected  Method getMethod()
           
 int getModifiers()
          This method gets the modifiers of the accessible object.
 Class<?> getReturnClass()
          This method gets the Class of the object returned when this accessor is invoked.
 GenericType<?> getReturnType()
          This method gets the GenericType of the object returned when this accessor is invoked.
 
Methods inherited from class net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorBase
getName, getPropertyType
 
Methods inherited from class net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessor
getPropertyClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.mmm.util.pojo.descriptor.api.accessor.PojoPropertyAccessor
getMode
 

Field Detail

method

private final Method method
See Also:
getMethod()

returnType

private final GenericType<?> returnType
See Also:
getReturnType()
Constructor Detail

AbstractPojoPropertyAccessorMethod

public AbstractPojoPropertyAccessorMethod(String propertyName,
                                          Type propertyType,
                                          PojoDescriptor<?> descriptor,
                                          PojoDescriptorDependencies dependencies,
                                          Method method)
The constructor.

Parameters:
propertyName - is the name of the property.
propertyType - is the generic type of the property.
descriptor - is the descriptor this accessor is intended for.
dependencies - are the PojoDescriptorDependencies to use.
method - is the method to access.
Method Detail

getMethod

protected Method getMethod()
Returns:
the method to access.
See Also:
getAccessibleObject()

getModifiers

public int getModifiers()
This method gets the modifiers of the accessible object.

Returns:
the modifiers of the field or method.
See Also:
Modifier, Field.getModifiers(), Method.getModifiers()

getAccessibleObject

public AccessibleObject getAccessibleObject()
This method gets the accessible object used to access (read/write) this property.

Returns:
the method to read this property or null if this property is NOT readable.
See Also:
PropertyDescriptor, Method, Constructor, Field

getDeclaringClass

public Class<?> getDeclaringClass()
This method gets the class reflecting the type that declared this accessor. It may be the pojo-class this accessor was created from but it may also be a super-class where the field or method of this accessor is inherited from and is NOT overridden.
E.g. the read-accessor for the property "class" will have the declaring-class Object.

Returns:
the class reflecting the type that declared this accessor.

getReturnType

public GenericType<?> getReturnType()
This method gets the GenericType of the object returned when this accessor is invoked.

Returns:
the return type.
See Also:
Method.getGenericReturnType(), Field.getGenericType()

getReturnClass

public Class<?> getReturnClass()
This method gets the Class of the object returned when this accessor is invoked.
is a convenience method for PojoPropertyAccessor.getReturnType(). getUpperBound()

Returns:
the return class.
See Also:
Method.getReturnType(), Field.getType()


Copyright © 2001-2010 mmm-Team. All Rights Reserved.