|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kohsuke.args4j.opts.MultiStringOption
public class MultiStringOption
Option that accompanies a strong value and can be specified multiple times.
For example, you can parse "-J opt1 -J opt2 -J opt3" into {"opt1","opt2","opt3"}.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.kohsuke.args4j.CmdLineOption |
---|
CmdLineOption.Parameters |
Field Summary | |
---|---|
private java.util.List |
_values
Actual modifiable data storage. |
private java.lang.String |
optionName
|
java.util.List |
values
Read-only view of the data store. |
Constructor Summary | |
---|---|
MultiStringOption(java.lang.String optionName)
|
|
MultiStringOption(java.lang.String optionName,
java.util.List storage)
Creates a new MultiStringOption that store
values into the specified List . |
Method Summary | |
---|---|
boolean |
accepts(java.lang.String optionName)
Checks if this option parser recognizes the specified option name. |
int |
parseArguments(CmdLineParser parser,
CmdLineOption.Parameters params)
Called if the option that this parser recognizes is found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.String optionName
private final java.util.List _values
public final java.util.List values
Constructor Detail |
---|
public MultiStringOption(java.lang.String optionName)
public MultiStringOption(java.lang.String optionName, java.util.List storage)
MultiStringOption
that store
values into the specified List
.
Method Detail |
---|
public boolean accepts(java.lang.String optionName)
CmdLineOption
accepts
in interface CmdLineOption
public int parseArguments(CmdLineParser parser, CmdLineOption.Parameters params) throws CmdLineException
CmdLineOption
parseArguments
in interface CmdLineOption
parser
- The parser that's using this option object.
For example, if the option "-quiet" is simply an alias to
"-verbose 5", then the implementation can just call the
CmdLineParser.parse(String[])
method recursively.params
- The rest of the arguments. This method can use this
object to access the arguments of the option if necessary.
CmdLineException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |