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 intThe 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 newCLIArgumentDefinitioninstance. -
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
-
m_Index
The index; only used for arguments (not for options).
-
-
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 newCLIArgumentDefinitioninstance.- 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-trueif the argument or option is mandatory.handler- The handler for the option or argument value.multiValued-trueif 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:
getSortKeyin classCLIDefinition- Returns:
- The sort key.
-
index
Returns the index of this argument.- Returns:
- The index.
-
toString
- Specified by:
toStringin classCLIDefinition
-
