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

java.lang.Object
  extended by net.sf.mmm.util.cli.base.CliParameterContainer
      extended by net.sf.mmm.util.cli.base.CliArgumentContainer

public class CliArgumentContainer
extends CliParameterContainer

This is a container for a CliArgument together with additional associated information.

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

Field Summary
private  CliArgument argument
           
private  InitializationState state
           
 
Constructor Summary
CliArgumentContainer(CliArgument argument, PojoPropertyAccessorOneArg setter, PojoPropertyAccessorNonArg getter, ValueValidator validator)
          The constructor.
 
Method Summary
 CliArgument getArgument()
          This method gets the actual CliArgument.
 CliContainerStyle getContainerStyle(CliStyle cliStyle)
          This method gets the style of this parameter.
 String getId()
          This method gets the ID of the argument.
protected  String getName()
          This method gets the name of the option or argument.
protected  Annotation getParameterAnnotation()
          This method gets the annotation with the metadata of the option or argument.
 InitializationState getState()
           
 void setState(InitializationState state)
           
 
Methods inherited from class net.sf.mmm.util.cli.base.CliParameterContainer
getGetter, getSetter, getValidator, isArrayMapOrCollection, isArrayMapOrCollection, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

argument

private final CliArgument argument
See Also:
getArgument()

state

private InitializationState state
See Also:
getState()
Constructor Detail

CliArgumentContainer

public CliArgumentContainer(CliArgument argument,
                            PojoPropertyAccessorOneArg setter,
                            PojoPropertyAccessorNonArg getter,
                            ValueValidator validator)
The constructor.

Parameters:
argument - is the argument.
setter - is the setter.
getter - is the getter
validator - is the validator.
Method Detail

getArgument

public CliArgument getArgument()
This method gets the actual CliArgument.

Returns:
the CliArgument.

getParameterAnnotation

protected Annotation getParameterAnnotation()
This method gets the annotation with the metadata of the option or argument.

Specified by:
getParameterAnnotation in class CliParameterContainer
Returns:
the Annotation.

getName

protected String getName()
This method gets the name of the option or argument.

Specified by:
getName in class CliParameterContainer
Returns:
the name of this parameter.

getId

public String getId()
This method gets the ID of the argument.

Returns:
the ID or the name if ID is not set.

getState

public InitializationState getState()
Returns:
the state

setState

public void setState(InitializationState state)
Parameters:
state - is the state to set

getContainerStyle

public CliContainerStyle getContainerStyle(CliStyle cliStyle)
This method gets the style of this parameter. If the style of the parameter-annotation ( CliArgument.containerStyle() or CliOption.containerStyle()) is CliContainerStyle.DEFAULT this method will return CliStyle.containerStyle().

Specified by:
getContainerStyle in class CliParameterContainer
Parameters:
cliStyle - TODO
Returns:
the style for this parameter.


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