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

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.PojoPropertyAccessorProxyRemove
All Implemented Interfaces:
PojoPropertyAccessor, PojoPropertyAccessorOneArg, PojoAttributeName

public class PojoPropertyAccessorProxyRemove
extends AbstractPojoPropertyAccessorProxyAdapterComponentType
implements PojoPropertyAccessorOneArg

This is the implementation of the PojoPropertyAccessorOneArg interface for removing 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)

Field Summary
private  PojoPropertyAccessorOneArg containerSetAccessor
          The according setter to use if array has to be resized.
 
Constructor Summary
PojoPropertyAccessorProxyRemove(PojoDescriptorDependencies dependencies, PojoPropertyAccessorNonArg containerGetAccessor, PojoPropertyAccessorOneArg containerSetAccessor)
          The constructor.
 
Method Summary
 PojoPropertyAccessorOneArgMode 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, Object argument)
          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
 

Field Detail

containerSetAccessor

private final PojoPropertyAccessorOneArg containerSetAccessor
The according setter to use if array has to be resized.

Constructor Detail

PojoPropertyAccessorProxyRemove

public PojoPropertyAccessorProxyRemove(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.
Method Detail

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.