|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.cli2.option.OptionImpl
public abstract class OptionImpl
A base implementation of Option providing limited ground work for further Option implementations.
| Constructor Summary | |
|---|---|
OptionImpl(int id,
boolean required)
Creates an OptionImpl with the specified id |
|
| Method Summary | |
|---|---|
boolean |
canProcess(WriteableCommandLine commandLine,
java.util.ListIterator arguments)
Indicates whether this Option will be able to process the particular argument. |
protected void |
checkPrefixes(java.util.Set prefixes)
|
void |
defaults(WriteableCommandLine commandLine)
Adds defaults to a CommandLine. |
boolean |
equals(java.lang.Object thatObj)
|
Option |
findOption(java.lang.String trigger)
Recursively searches for an option with the supplied trigger. |
int |
getId()
Returns the id of the option. |
int |
hashCode()
|
boolean |
isRequired()
Indicates whether this option is required to be present. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.commons.cli2.Option |
|---|
appendUsage, canProcess, getDescription, getPreferredName, getPrefixes, getTriggers, helpLines, process, validate |
| Constructor Detail |
|---|
public OptionImpl(int id,
boolean required)
id - the unique id of this Optionrequired - true iff this Option must be present| Method Detail |
|---|
public boolean canProcess(WriteableCommandLine commandLine,
java.util.ListIterator arguments)
Option
canProcess in interface Optionarguments - the ListIterator over String arguments
Option.canProcess(WriteableCommandLine,String)public java.lang.String toString()
toString in class java.lang.Objectpublic int getId()
Option
for(Option o : cmd.getOptions()){
switch(o.getId()){
case POTENTIAL_OPTION:
...
}
}
The returned value is not guarenteed to be unique.
getId in interface Optionpublic boolean equals(java.lang.Object thatObj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic Option findOption(java.lang.String trigger)
Option
findOption in interface Optiontrigger - the trigger to search for.
public boolean isRequired()
Option
isRequired in interface Optionpublic void defaults(WriteableCommandLine commandLine)
Option
defaults in interface OptioncommandLine - The CommandLine object to store defaults inprotected void checkPrefixes(java.util.Set prefixes)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||