net.sf.mmm.util.pojo.descriptor.impl.accessor
Class PojoPropertyAccessorProxyGetSize

java.lang.Object
  extended by net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessor
      extended by net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxy
          extended by net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxyAdapter
              extended by net.sf.mmm.util.pojo.descriptor.impl.accessor.PojoPropertyAccessorProxyGetSize
All Implemented Interfaces:
PojoPropertyAccessor, PojoPropertyAccessorNonArg, PojoAttributeName

public class PojoPropertyAccessorProxyGetSize
extends AbstractPojoPropertyAccessorProxyAdapter
implements PojoPropertyAccessorNonArg

This is the implementation of the PojoPropertyAccessorNonArg interface for getting the size of an array, List or Map from another accessor.

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

Constructor Summary
PojoPropertyAccessorProxyGetSize(PojoDescriptorDependencies dependencies, PojoPropertyAccessorNonArg containerGetAccessor)
          The constructor.
 
Method Summary
 PojoPropertyAccessorNonArgMode getMode()
          This method gets the mode of this accessor.
 Class<?> getPropertyClass()
          This method gets the type as Class.
 GenericType<?> getPropertyType()
          This method gets the GenericType of this property.
 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.
 Object invoke(Object pojoInstance)
          This method invokes the according property-method of pojoInstance with the given arguments.
 
Methods inherited from class net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxyAdapter
getDelegate, getDependencies
 
Methods inherited from class net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxy
getAccessibleObject, getDeclaringClass, getModifiers, getName
 
Methods inherited from class net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessor
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
getAccessibleObject, getDeclaringClass, getModifiers
 
Methods inherited from interface net.sf.mmm.util.pojo.descriptor.api.attribute.PojoAttributeName
getName
 

Constructor Detail

PojoPropertyAccessorProxyGetSize

public PojoPropertyAccessorProxyGetSize(PojoDescriptorDependencies dependencies,
                                        PojoPropertyAccessorNonArg containerGetAccessor)
The constructor.

Parameters:
dependencies - are the PojoDescriptorDependencies to use.
containerGetAccessor - is the accessor delegate that gets an array, map or collection property.
Method Detail

getMode

public PojoPropertyAccessorNonArgMode getMode()
This method gets the mode of this accessor.

Specified by:
getMode in interface PojoPropertyAccessor
Specified by:
getMode in interface PojoPropertyAccessorNonArg
Overrides:
getMode in class AbstractPojoPropertyAccessorProxy
Returns:
the access mode.

getPropertyType

public GenericType<?> getPropertyType()
This method gets the GenericType of this property.
For a getter this will be the return-type while a setter typically has void as return-type and this method will return the type of its argument. For mapped or indexed getters/setters this method will return the item type.

Specified by:
getPropertyType in interface PojoPropertyAccessor
Overrides:
getPropertyType in class AbstractPojoPropertyAccessorProxy
Returns:
the GenericType reflecting the property.
See Also:
PojoPropertyAccessor.getPropertyClass(), PropertyDescriptor

getPropertyClass

public Class<?> getPropertyClass()
This method gets the type as Class. It is a convenience method for PojoPropertyAccessor.getPropertyType(). getUpperBound() if the mode is for reading and PojoPropertyAccessor.getPropertyType(). getLowerBound() otherwise.

Specified by:
getPropertyClass in interface PojoPropertyAccessor
Overrides:
getPropertyClass in class AbstractPojoPropertyAccessorProxy
Returns:
the Class reflecting the property.

getReturnType

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

Specified by:
getReturnType in interface PojoPropertyAccessor
Overrides:
getReturnType in class AbstractPojoPropertyAccessorProxy
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()

Specified by:
getReturnClass in interface PojoPropertyAccessor
Overrides:
getReturnClass in class AbstractPojoPropertyAccessorProxy
Returns:
the return class.
See Also:
Method.getReturnType(), Field.getType()

invoke

public Object invoke(Object pojoInstance)
This method invokes the according property-method of pojoInstance with the given arguments.

Specified by:
invoke in interface PojoPropertyAccessorNonArg
Parameters:
pojoInstance - is the instance of the POJO where to access the property. Has to be an instance of the type from where this accessor was created for.
Returns:
the result of the invocation. It will be null if void (e.g. initialize method). For a regular getter this will be the value of the property.


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