net.sf.mmm.util.cli.base
Class CliValueContainerCollection

java.lang.Object
  extended by net.sf.mmm.util.cli.base.AbstractCliValueContainer
      extended by net.sf.mmm.util.cli.base.AbstractCliValueContainerContainer
          extended by net.sf.mmm.util.cli.base.CliValueContainerCollection
All Implemented Interfaces:
CliValueContainer
Direct Known Subclasses:
CliValueContainerArray

public class CliValueContainerCollection
extends AbstractCliValueContainerContainer

This is an implementation of CliValueContainer for a Collection.

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

Field Summary
private  Collection<Object> collection
           
 
Constructor Summary
CliValueContainerCollection(CliParameterContainer parameterContainer, CliState cliState, CliParserDependencies dependencies, org.slf4j.Logger logger, Collection<Object> value)
          The constructor.
 
Method Summary
 Collection<Object> getCollection()
           
 Object getValue()
          This method gets the value of a option or a argument.
protected  void setValueEntry(String entry, GenericType<?> propertyType)
          This method is like AbstractCliValueContainerContainer.setValue(String) but for a single entry.
protected  void setValueInternal(Object containerValue)
          This method sets the container value as new object.
 
Methods inherited from class net.sf.mmm.util.cli.base.AbstractCliValueContainerContainer
isArrayMapOrCollection, setValue, setValueInternal
 
Methods inherited from class net.sf.mmm.util.cli.base.AbstractCliValueContainer
getCliState, getDependencies, getLogger, getParameterContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collection

private Collection<Object> collection
See Also:
getValue()
Constructor Detail

CliValueContainerCollection

public CliValueContainerCollection(CliParameterContainer parameterContainer,
                                   CliState cliState,
                                   CliParserDependencies dependencies,
                                   org.slf4j.Logger logger,
                                   Collection<Object> value)
The constructor.

Parameters:
parameterContainer - is the parameter-container.
cliState - is the state.
dependencies - are the dependencies.
logger - is the logger.
value - is the initial, empty Collection-value.
Method Detail

getValue

public Object getValue()
This method gets the value of a option or a argument.

Returns:
the value.

getCollection

public Collection<Object> getCollection()
Returns:
the collection

setValueInternal

protected void setValueInternal(Object containerValue)
This method sets the container value as new object.

Specified by:
setValueInternal in class AbstractCliValueContainerContainer
Parameters:
containerValue - is the container value to set.

setValueEntry

protected void setValueEntry(String entry,
                             GenericType<?> propertyType)
This method is like AbstractCliValueContainerContainer.setValue(String) but for a single entry.

Specified by:
setValueEntry in class AbstractCliValueContainerContainer
Parameters:
entry - is a single collection-entry given as string.
propertyType - is the GenericType of the container.
See Also:
CliContainerStyle.MULTIPLE_OCCURRENCE


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