net.sf.mmm.util.pojo.descriptor.api.accessor
Class PojoPropertyAccessorOneArgMode

java.lang.Object
  extended by net.sf.mmm.util.pojo.descriptor.api.accessor.PojoPropertyAccessorMode<PojoPropertyAccessorOneArg>
      extended by net.sf.mmm.util.pojo.descriptor.api.accessor.PojoPropertyAccessorOneArgMode

public class PojoPropertyAccessorOneArgMode
extends PojoPropertyAccessorMode<PojoPropertyAccessorOneArg>

An instance of this class represents a specific accessor-mode for a one-arg accessor of a property. This abstract base class acts like an Enum but allows you to define your own custom mode by extending this class.

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

Field Summary
static PojoPropertyAccessorOneArgMode ADD
          The mode for an accessor used to add an item to a property with a container (array or Collection) type.
static PojoPropertyAccessorOneArgMode GET_MAPPED
          The mode for a getter of a mapped property.
static PojoPropertyAccessorOneArgMode REMOVE
          The mode for an accessor used to remove an item from a property with an container (array or Collection) type.
static PojoPropertyAccessorOneArgMode SET
          The mode for a regular setter of a property.
 
Constructor Summary
protected PojoPropertyAccessorOneArgMode(String name, boolean reading)
          The constructor.
 
Method Summary
 
Methods inherited from class net.sf.mmm.util.pojo.descriptor.api.accessor.PojoPropertyAccessorMode
getName, isReading, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SET

public static final PojoPropertyAccessorOneArgMode SET
The mode for a regular setter of a property.


ADD

public static final PojoPropertyAccessorOneArgMode ADD
The mode for an accessor used to add an item to a property with a container (array or Collection) type. The accessor will add the item given as argument to the end of the container (if ordered). If the container is an array a copy with a size increased by 1 has to be created. Therefore a virtual add-accessor can only be generated for array-type getters if also an according setter is present.

See Also:
Collection.add(Object)

REMOVE

public static final PojoPropertyAccessorOneArgMode REMOVE
The mode for an accessor used to remove an item from a property with an container (array or Collection) type. The accessor will remove the first occurrence of the item given as argument from the container. It will return true on success and false if the item was NOT found in the container. If the container is an array a copy with a size decreased by 1 has to be created. Therefore a virtual remove-accessor can only be generated for array-type getters if also an according setter is present.

See Also:
Collection.remove(Object)

GET_MAPPED

public static final PojoPropertyAccessorOneArgMode GET_MAPPED
The mode for a getter of a mapped property.
For example an invoke with argument key for a property named "colors" might cause a pojo.getColors().get(key) or pojo.getColors(key) or even pojo.getColor(key).

Constructor Detail

PojoPropertyAccessorOneArgMode

protected PojoPropertyAccessorOneArgMode(String name,
                                         boolean reading)
The constructor.

Parameters:
name - is the name of this mode.
reading - is a flag that determines if this mode is for reading.


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