Package org.apache.commons.cli.avalon
Class CLOption
java.lang.Object
org.apache.commons.cli.avalon.CLOption
Basic class describing an instance of option.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Value ofCLOptionDescriptor.getId()
when the option is a text argument. -
Constructor Summary
ConstructorDescriptionConstructor taking argument for option.CLOption
(CLOptionDescriptor descriptor) Constructor taking an descriptor -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addArgument
(String argument) Mutator of Argument property.final String
Retrieve argument to option if it takes arguments.final String
getArgument
(int index) Retrieve indexed argument to option if it takes arguments.final int
Get number of arguments.final CLOptionDescriptor
final String
toString()
Convert to String.
-
Field Details
-
TEXT_ARGUMENT
public static final int TEXT_ARGUMENTValue ofCLOptionDescriptor.getId()
when the option is a text argument.- See Also:
-
-
Constructor Details
-
CLOption
Constructor taking an descriptor- Parameters:
descriptor
- the descriptor iff null, will default to a "text argument" descriptor.
-
CLOption
Constructor taking argument for option.- Parameters:
argument
- the argument
-
-
Method Details
-
getArgument
Retrieve argument to option if it takes arguments.- Returns:
- the (first) argument
-
getArgument
Retrieve indexed argument to option if it takes arguments.- Parameters:
index
- The argument index, from 0 togetArgumentCount()
-1.- Returns:
- the argument
-
getDescriptor
-
addArgument
Mutator of Argument property.- Parameters:
argument
- the argument
-
getArgumentCount
public final int getArgumentCount()Get number of arguments.- Returns:
- the number of arguments
-
toString
Convert to String.
-