net.dpml.cli.option
public abstract class OptionImpl extends Object implements Option
Version: @PROJECT-VERSION@
Constructor Summary | |
---|---|
OptionImpl(int id, boolean required)
Creates an OptionImpl with the specified id |
Method Summary | |
---|---|
boolean | canProcess(WriteableCommandLine commandLine, ListIterator arguments)
Indicates whether this Option will be able to process the particular
argument. |
protected void | checkPrefixes(Set prefixes)
Check prefixes. |
void | defaults(WriteableCommandLine commandLine)
Adds defaults to a CommandLine.
|
boolean | equals(Object thatObj)
Evaluate this instance against the supplied instance for equality. |
Option | findOption(String trigger)
Recursively searches for an option with the supplied trigger.
|
int | getId()
Returns the id of the option. |
int | hashCode()
Return the hashcode value for this instance. |
boolean | isRequired()
Indicates whether this option is required to be present. |
String | toString()
Returns a string representation of the option. |
Parameters: id the unique id of this Option required true iff this Option must be present
Parameters: commandLine the CommandLine object to store defaults in arguments the ListIterator over String arguments
Returns: true if the argument can be processed by this Option
See Also: OptionImpl
Parameters: prefixes the prefixes set
Parameters: commandLine the CommandLine object to store defaults in
Parameters: thatObj the other object
Returns: true if the supplied instance is equal to this instance
Parameters: trigger the trigger to search for.
Returns: the matching option or null.
for(Option o : cmd.getOptions()){
switch(o.getId()){
case POTENTIAL_OPTION:
...
}
}
The returned value is not guarenteed to be unique.
Returns: the id of the option.
Returns: the hash value
Returns: true if the CommandLine will be invalid without this Option
Returns: the string value