|
||||||||||
| 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.ArgumentImpl
org.apache.commons.cli2.option.SourceDestArgument
public class SourceDestArgument
An Argument implementation that allows a variable size Argument to precede a
fixed size argument. The canonical example of it's use is in the unix
cp command where a number of source can be specified with
exactly one destination specfied at the end.
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.cli2.option.ArgumentImpl |
|---|
DEFAULT_CONSUME_REMAINING, DEFAULT_INITIAL_SEPARATOR, DEFAULT_SUBSEQUENT_SEPARATOR |
| Constructor Summary | |
|---|---|
SourceDestArgument(Argument source,
Argument dest)
Creates a SourceDestArgument using defaults where possible. |
|
SourceDestArgument(Argument source,
Argument dest,
char initialSeparator,
char subsequentSeparator,
String consumeRemaining,
List defaultValues)
Creates a SourceDestArgument using the specified parameters. |
|
| Method Summary | |
|---|---|
void |
appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
Appends usage information to the specified StringBuffer |
boolean |
canProcess(WriteableCommandLine commandLine,
String arg)
Indicates whether this Option will be able to process the particular argument. |
List |
helpLines(int depth,
Set helpSettings,
Comparator comp)
Builds up a list of HelpLineImpl instances to be presented by HelpFormatter. |
void |
validate(WriteableCommandLine commandLine,
Option option)
Performs any necessary validation on the values added to the CommandLine. |
| Methods inherited from class org.apache.commons.cli2.option.ArgumentImpl |
|---|
defaults, defaultValues, getConsumeRemaining, getDefaultValues, getDescription, getInitialSeparator, getMaximum, getMinimum, getPreferredName, getPrefixes, getSubsequentSeparator, getTriggers, getValidator, isRequired, process, processValues, stripBoundaryQuotes, validate |
| Methods inherited from class org.apache.commons.cli2.option.OptionImpl |
|---|
canProcess, checkPrefixes, equals, findOption, getId, getParent, hashCode, setParent, 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 |
|---|
canProcess, findOption, getId, getParent, setParent |
| Constructor Detail |
|---|
public SourceDestArgument(Argument source,
Argument dest)
source - the variable size Argumentdest - the fixed size Argument
public SourceDestArgument(Argument source,
Argument dest,
char initialSeparator,
char subsequentSeparator,
String consumeRemaining,
List defaultValues)
source - the variable size Argumentdest - the fixed size ArgumentinitialSeparator - the inistial separator to usesubsequentSeparator - the subsequent separator to useconsumeRemaining - the token triggering consume remaining behaviourdefaultValues - the default values for the SourceDestArgument| Method Detail |
|---|
public void appendUsage(StringBuffer buffer,
Set helpSettings,
Comparator comp)
Option
appendUsage in interface OptionappendUsage in class ArgumentImplbuffer - the buffer to append tohelpSettings - a set of display settings @see DisplaySettingcomp - a comparator used to sort the Options
public List helpLines(int depth,
Set helpSettings,
Comparator comp)
Option
helpLines in interface OptionhelpLines in class ArgumentImpldepth - the initial indent depthhelpSettings - the HelpSettings that should be appliedcomp - a comparator used to sort options when applicable.
HelpLine,
HelpFormatter
public void validate(WriteableCommandLine commandLine,
Option option)
throws OptionException
Argument
validate in interface Argumentvalidate in class ArgumentImplcommandLine - The CommandLine object to query.option - The option to lookup values with.
OptionException - if any problems occur.CommandLine.getValues(Option)
public boolean canProcess(WriteableCommandLine commandLine,
String arg)
Option
canProcess in interface OptioncanProcess in class ArgumentImplcommandLine - The CommandLine to checkarg - The argument to be tested
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||