public class SourceDestArgument extends ArgumentImpl
cp
command where a number of source can be specified with
exactly one destination specfied at the end.DEFAULT_CONSUME_REMAINING, DEFAULT_INITIAL_SEPARATOR, DEFAULT_SUBSEQUENT_SEPARATOR
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
defaults, defaultValues, getConsumeRemaining, getDefaultValues, getDescription, getInitialSeparator, getMaximum, getMinimum, getPreferredName, getPrefixes, getSubsequentSeparator, getTriggers, getValidator, isRequired, process, processValues, stripBoundaryQuotes, validate
canProcess, checkPrefixes, equals, findOption, getId, getParent, hashCode, setParent, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
canProcess, findOption, getId, getParent, setParent
public SourceDestArgument(Argument source, Argument dest)
source
- the variable size Argumentdest
- the fixed size Argumentpublic 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 SourceDestArgumentpublic void appendUsage(StringBuffer buffer, Set helpSettings, Comparator comp)
Option
appendUsage
in interface Option
appendUsage
in class ArgumentImpl
buffer
- the buffer to append tohelpSettings
- a set of display settings @see DisplaySettingcomp
- a comparator used to sort the Optionspublic List helpLines(int depth, Set helpSettings, Comparator comp)
Option
helpLines
in interface Option
helpLines
in class ArgumentImpl
depth
- 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 Argument
validate
in class ArgumentImpl
commandLine
- 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 Option
canProcess
in class ArgumentImpl
commandLine
- The CommandLine to checkarg
- The argument to be testedCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.