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

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.AbstractPojoPropertyAccessorField
All Implemented Interfaces:
PojoPropertyAccessor, PojoAttributeName
Direct Known Subclasses:
PojoPropertyAccessorGetField, PojoPropertyAccessorSetField

public abstract class AbstractPojoPropertyAccessorField
extends AbstractPojoPropertyAccessorBase

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

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

Field Summary
private  Field field
           
 
Constructor Summary
AbstractPojoPropertyAccessorField(PojoDescriptor<?> descriptor, PojoDescriptorDependencies dependencies, Field field)
          The constructor.
AbstractPojoPropertyAccessorField(String propertyName, Type propertyType, PojoDescriptor<?> descriptor, PojoDescriptorDependencies dependencies, Field field)
          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  Field getField()
           
 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

field

private final Field field
See Also:
getField()
Constructor Detail

AbstractPojoPropertyAccessorField

public AbstractPojoPropertyAccessorField(PojoDescriptor<?> descriptor,
                                         PojoDescriptorDependencies dependencies,
                                         Field field)
The constructor.

Parameters:
descriptor - is the descriptor this accessor is intended for.
dependencies - are the PojoDescriptorDependencies to use.
field - is the field to access.

AbstractPojoPropertyAccessorField

public AbstractPojoPropertyAccessorField(String propertyName,
                                         Type propertyType,
                                         PojoDescriptor<?> descriptor,
                                         PojoDescriptorDependencies dependencies,
                                         Field field)
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.
field - is the field to access.
Method Detail

getField

protected Field getField()
Returns:
the field 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.