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

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.base.accessor.AbstractPojoPropertyAccessorProxyAdapterComponentType
                  extended by net.sf.mmm.util.pojo.descriptor.impl.accessor.PojoPropertyAccessorProxyGetIndexed
All Implemented Interfaces:
PojoPropertyAccessor, PojoPropertyAccessorIndexedNonArg, PojoAttributeName

public class PojoPropertyAccessorProxyGetIndexed
extends AbstractPojoPropertyAccessorProxyAdapterComponentType
implements PojoPropertyAccessorIndexedNonArg

This is the implementation of the PojoPropertyAccessorIndexedNonArg interface for getting an element from another accessor returning an array or List.

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

Constructor Summary
PojoPropertyAccessorProxyGetIndexed(PojoDescriptorDependencies dependencies, PojoPropertyAccessorNonArg containerGetAccessor)
          The constructor.
 
Method Summary
 PojoPropertyAccessorIndexedNonArgMode getMode()
          This method gets the mode of this accessor.
 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, int index)
          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.AbstractPojoPropertyAccessorProxyAdapterComponentType
getPropertyClass, getPropertyType
 
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, getPropertyClass, getPropertyType
 
Methods inherited from interface net.sf.mmm.util.pojo.descriptor.api.attribute.PojoAttributeName
getName
 

Constructor Detail

PojoPropertyAccessorProxyGetIndexed

public PojoPropertyAccessorProxyGetIndexed(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 PojoPropertyAccessorIndexedNonArgMode getMode()
This method gets the mode of this accessor.

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

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,
                     int index)
This method invokes the according property-method of pojoInstance with the given arguments.

Specified by:
invoke in interface PojoPropertyAccessorIndexedNonArg
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.
index - is the position in the indexed property (e.g. where to get or remove an item).
Returns:
the result of the invocation. Will be null if void (e.g. remove method).


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