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

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

public class PojoPropertyAccessorIndexedOneArgMethod
extends AbstractPojoPropertyAccessorMethod
implements PojoPropertyAccessorIndexedOneArg

This is the implementation of the PojoPropertyAccessorIndexedOneArg interface for accessing a Method.

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

Field Summary
private  boolean inverted
          false if index is first argument, true if second.
private  PojoPropertyAccessorIndexedOneArgMode mode
           
 
Constructor Summary
PojoPropertyAccessorIndexedOneArgMethod(String propertyName, Type propertyType, PojoPropertyAccessorIndexedOneArgMode mode, PojoDescriptor<?> descriptor, PojoDescriptorDependencies dependencies, Method method, boolean inverted)
          The constructor.
 
Method Summary
 PojoPropertyAccessorIndexedOneArgMode getMode()
          This method gets the mode of this accessor.
 Object invoke(Object pojoInstance, int index, Object item)
          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.AbstractPojoPropertyAccessorMethod
getAccessibleObject, getDeclaringClass, getMethod, getModifiers, getReturnClass, getReturnType
 
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
getAccessibleObject, getDeclaringClass, getModifiers, getPropertyClass, getPropertyType, getReturnClass, getReturnType
 
Methods inherited from interface net.sf.mmm.util.pojo.descriptor.api.attribute.PojoAttributeName
getName
 

Field Detail

mode

private final PojoPropertyAccessorIndexedOneArgMode mode
See Also:
getMode()

inverted

private final boolean inverted
false if index is first argument, true if second.

Constructor Detail

PojoPropertyAccessorIndexedOneArgMethod

public PojoPropertyAccessorIndexedOneArgMethod(String propertyName,
                                               Type propertyType,
                                               PojoPropertyAccessorIndexedOneArgMode mode,
                                               PojoDescriptor<?> descriptor,
                                               PojoDescriptorDependencies dependencies,
                                               Method method,
                                               boolean inverted)
The constructor.

Parameters:
propertyName - is the name of the property.
propertyType - is the generic type of the property.
mode - is the mode of access.
descriptor - is the descriptor this accessor is intended for.
dependencies - are the PojoDescriptorDependencies to use.
method - is the method to access.
inverted - - false if the index is first method-argument, true if it is the second argument.
Method Detail

invoke

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

Specified by:
invoke in interface PojoPropertyAccessorIndexedOneArg
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 where to apply (e.g. set or insert) the given item.
item - is the value to apply (e.g. set or insert) as element of the indexed property.
Returns:
the result of the invocation. Will be null if void (e.g. regular setter method).

getMode

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

Specified by:
getMode in interface PojoPropertyAccessor
Specified by:
getMode in interface PojoPropertyAccessorIndexedOneArg
Returns:
the access mode.


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