net.sf.mmm.util.pojo.descriptor.impl.accessor
Class PojoPropertyAccessorProxyAdd
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.PojoPropertyAccessorProxyAdd
- All Implemented Interfaces:
- PojoPropertyAccessor, PojoPropertyAccessorOneArg, PojoAttributeName
public class PojoPropertyAccessorProxyAdd
- extends AbstractPojoPropertyAccessorProxyAdapterComponentType
- implements PojoPropertyAccessorOneArg
This is the implementation of the PojoPropertyAccessorOneArg
interface for adding an element
using the getter from another accessor returning an array or
Collection.
- 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.
PojoPropertyAccessorProxyAdd
public PojoPropertyAccessorProxyAdd(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
Collection property. May be null if
NOT available.
getMode
public PojoPropertyAccessorOneArgMode getMode()
- This method gets the mode of this accessor.
- Specified by:
getMode in interface PojoPropertyAccessor- Specified by:
getMode in interface PojoPropertyAccessorOneArg- 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,
Object argument)
- This method invokes the according property-method of
pojoInstance with the given arguments.
- Specified by:
invoke in interface PojoPropertyAccessorOneArg
- 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.argument - is the value of the property to set.
- Returns:
- the result of the invocation. Will be
null if void
(e.g. regular setter method).
Copyright © 2001-2010 mmm-Team. All Rights Reserved.