Class CLIArgumentDefinition
java.lang.Object
org.tquadrat.foundation.config.spi.CLIDefinition
org.tquadrat.foundation.config.spi.CLIArgumentDefinition
@ClassVersion(sourceVersion="$Id: CLIArgumentDefinition.java 1076 2023-10-03 18:36:07Z tquadrat $")
@API(status=STABLE,
since="0.0.1")
public class CLIArgumentDefinition
extends CLIDefinition
Run-time copy of the
@Argument
annotation. By definition, unnamed options are arguments (and instances of
this class). Named options are actually another subclass
of
CLIDefinition
.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Thanks to:
- Mark Sinke
- Version:
- $Id: CLIArgumentDefinition.java 1076 2023-10-03 18:36:07Z tquadrat $
- Since:
- 0.0.1
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.config.spi.CLIArgumentDefinition"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The index; only used for arguments (not for options).Fields inherited from class org.tquadrat.foundation.config.spi.CLIDefinition
MSGKEY_EmptyIsInvalid, MSGKEY_InvalidName, MSGKEY_ReservedName, MSGKEY_Whitespace1, MSGKEY_Whitespace2, MSGKEY_WrongLeadIn, USAGE_KEY_FORMAT
-
Constructor Summary
ConstructorsConstructorDescriptionCLIArgumentDefinition
(String property, int index, String usage, String usageKey, String metaVar, boolean required, CmdLineValueHandler<?> handler, boolean multiValued, String format) Creates a newCLIArgumentDefinition
instance. -
Method Summary
Methods inherited from class org.tquadrat.foundation.config.spi.CLIDefinition
format, handler, isArgument, isMultiValued, metaVar, processParameters, propertyName, required, usage, usageKey, validateOptionName
-
Field Details
-
Constructor Details
-
CLIArgumentDefinition
public CLIArgumentDefinition(String property, int index, String usage, String usageKey, String metaVar, boolean required, CmdLineValueHandler<?> handler, boolean multiValued, String format) Creates a newCLIArgumentDefinition
instance.- Parameters:
property
- The name of the property.index
- The position for this argument on the command line.usage
- The usage text.usageKey
- The resource bundle key for the usage text.metaVar
- The meta variable name.required
-true
if the argument or option is mandatory.handler
- The handler for the option or argument value.multiValued
-true
if the option or argument allows more than one value.format
- The optional format.
-
-
Method Details
-
getSortKey
Returns the sort key for the option or argument.- Specified by:
getSortKey
in classCLIDefinition
- Returns:
- The sort key.
-
index
Returns the index of this argument.- Returns:
- The index.
-
toString
- Specified by:
toString
in classCLIDefinition
-