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

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

public class CliOptionContainer
extends CliParameterContainer

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

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

Field Summary
private  CliOption option
           
 
Constructor Summary
CliOptionContainer(CliOption option, PojoPropertyAccessorOneArg setter, PojoPropertyAccessorNonArg getter, ValueValidator validator)
          The constructor.
 
Method Summary
 CliContainerStyle getContainerStyle(CliStyle cliStyle)
          This method gets the style of this parameter.
protected  String getName()
          This method gets the name of the option or argument.
 CliOption getOption()
          This method gets the actual CliOption.
protected  Annotation getParameterAnnotation()
          This method gets the annotation with the metadata of the option or argument.
 boolean isTrigger()
          This method determines if the option is a trigger.
 
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

option

private final CliOption option
See Also:
getOption()
Constructor Detail

CliOptionContainer

public CliOptionContainer(CliOption option,
                          PojoPropertyAccessorOneArg setter,
                          PojoPropertyAccessorNonArg getter,
                          ValueValidator validator)
The constructor.

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

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.

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.

getOption

public CliOption getOption()
This method gets the actual CliOption.

Returns:
the CliOption.

isTrigger

public boolean isTrigger()
This method determines if the option is a trigger. Trigger means that the type of the setter is a primitive boolean and the option is never followed by a value on the commandline.

Returns:
true if trigger, false otherwise.

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.