|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.cli2.option.OptionImpl
org.apache.commons.cli2.option.ParentImpl
public abstract class ParentImpl
A base implementation of Parent providing limited ground work for further Parent implementations.
Field Summary | |
---|---|
private Argument |
argument
|
private Group |
children
|
private java.lang.String |
description
|
private static char |
NUL
|
Constructor Summary | |
---|---|
protected |
ParentImpl(Argument argument,
Group children,
java.lang.String description,
int id,
boolean required)
|
Method Summary | |
---|---|
void |
appendUsage(java.lang.StringBuffer buffer,
java.util.Set helpSettings,
java.util.Comparator comp)
Appends usage information to the specified StringBuffer |
boolean |
canProcess(WriteableCommandLine commandLine,
java.lang.String arg)
Indicates whether this Option will be able to process the particular argument. |
void |
defaults(WriteableCommandLine commandLine)
Adds defaults to a CommandLine. |
Option |
findOption(java.lang.String trigger)
Recursively searches for an option with the supplied trigger. |
Argument |
getArgument()
|
Group |
getChildren()
|
java.lang.String |
getDescription()
Returns a description of the option. |
java.util.Set |
getPrefixes()
Identifies the argument prefixes that should be considered options. |
private void |
handleInitialSeparator(java.util.ListIterator arguments,
char separator)
Split the token using the specified separator character. |
java.util.List |
helpLines(int depth,
java.util.Set helpSettings,
java.util.Comparator comp)
Builds up a list of HelpLineImpl instances to be presented by HelpFormatter. |
void |
process(WriteableCommandLine commandLine,
java.util.ListIterator arguments)
Processes String arguments into a CommandLine. |
void |
validate(WriteableCommandLine commandLine)
Checks that the supplied CommandLine is valid with respect to this option. |
Methods inherited from class org.apache.commons.cli2.option.OptionImpl |
---|
canProcess, checkPrefixes, equals, getId, hashCode, isRequired, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.commons.cli2.Parent |
---|
processParent |
Methods inherited from interface org.apache.commons.cli2.Option |
---|
canProcess, getId, getPreferredName, getTriggers, isRequired |
Field Detail |
---|
private static final char NUL
private final Group children
private final Argument argument
private final java.lang.String description
Constructor Detail |
---|
protected ParentImpl(Argument argument, Group children, java.lang.String description, int id, boolean required)
Method Detail |
---|
public void process(WriteableCommandLine commandLine, java.util.ListIterator arguments) throws OptionException
Option
process
in interface Option
commandLine
- The CommandLine object to store results inarguments
- The arguments to process
OptionException
- if any problems occurpublic boolean canProcess(WriteableCommandLine commandLine, java.lang.String arg)
Option
canProcess
in interface Option
arg
- The argument to be tested
public java.util.Set getPrefixes()
Option
getPrefixes
in interface Option
public void validate(WriteableCommandLine commandLine) throws OptionException
Option
validate
in interface Option
commandLine
- The CommandLine to check.
OptionException
- if the CommandLine is not valid.public void appendUsage(java.lang.StringBuffer buffer, java.util.Set helpSettings, java.util.Comparator comp)
Option
appendUsage
in interface Option
buffer
- the buffer to append tohelpSettings
- a set of display settings @see DisplaySettingcomp
- a comparator used to sort the Optionspublic java.lang.String getDescription()
Option
getDescription
in interface Option
HelpFormatter
public java.util.List helpLines(int depth, java.util.Set helpSettings, java.util.Comparator comp)
Option
helpLines
in interface Option
depth
- the initial indent depthhelpSettings
- the HelpSettings that should be appliedcomp
- a comparator used to sort options when applicable.
HelpLine
,
HelpFormatter
public Argument getArgument()
public Group getChildren()
private void handleInitialSeparator(java.util.ListIterator arguments, char separator)
arguments
- the current position in the arguments iteratorseparator
- the separator char to split onpublic Option findOption(java.lang.String trigger)
Option
findOption
in interface Option
findOption
in class OptionImpl
trigger
- the trigger to search for.
public void defaults(WriteableCommandLine commandLine)
Option
defaults
in interface Option
defaults
in class OptionImpl
commandLine
- The CommandLine object to store defaults in
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |