net.sf.mmm.util.pojo.descriptor.impl.accessor
Class PojoPropertyAccessorProxySetIndexed
java.lang.Object
net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessor
net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxy
net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxyAdapter
net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxyAdapterComponentType
net.sf.mmm.util.pojo.descriptor.impl.accessor.PojoPropertyAccessorProxySetIndexed
- All Implemented Interfaces:
- PojoPropertyAccessor, PojoPropertyAccessorIndexedOneArg, PojoAttributeName
public class PojoPropertyAccessorProxySetIndexed
- extends AbstractPojoPropertyAccessorProxyAdapterComponentType
- implements PojoPropertyAccessorIndexedOneArg
This is the implementation of the PojoPropertyAccessorIndexedOneArg
interface for setting an indexed property using the getter from another accessor returning
an array or List.
- Since:
- 1.1.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
containerSetAccessor
private final PojoPropertyAccessorOneArg containerSetAccessor
- The according setter to use if array has to be resized.
PojoPropertyAccessorProxySetIndexed
public PojoPropertyAccessorProxySetIndexed(PojoDescriptorDependencies dependencies,
PojoPropertyAccessorNonArg containerGetAccessor,
PojoPropertyAccessorOneArg containerSetAccessor)
- The constructor.
- Parameters:
dependencies - are the PojoDescriptorDependencies to use.containerGetAccessor - is the accessor delegate that gets an array, or
List property.containerSetAccessor - is the accessor that sets the array, or
List property. May be null if NOT
available.
getMode
public PojoPropertyAccessorIndexedOneArgMode getMode()
- This method gets the mode of this accessor.
- Specified by:
getMode in interface PojoPropertyAccessor- Specified by:
getMode in interface PojoPropertyAccessorIndexedOneArg- 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,
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).
Copyright © 2001-2010 mmm-Team. All Rights Reserved.