|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.env.CommandLineArgs
class CommandLineArgs
A simple representation of command line arguments, broken into "option arguments" and "non-option arguments".
SimpleCommandLineArgsParser
Field Summary | |
---|---|
private java.util.List<java.lang.String> |
nonOptionArgs
|
private java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
optionArgs
|
Constructor Summary | |
---|---|
CommandLineArgs()
|
Method Summary | |
---|---|
void |
addNonOptionArg(java.lang.String value)
Add the given value to the list of non-option arguments. |
void |
addOptionArg(java.lang.String optionName,
java.lang.String optionValue)
Add an option argument for the given option name and add the given value to the list of values associated with this option (of which there may be zero or more). |
boolean |
containsOption(java.lang.String optionName)
Return whether the option with the given name was present on the command line. |
java.util.List<java.lang.String> |
getNonOptionArgs()
Return the list of non-option arguments specified on the command line. |
java.util.Set<java.lang.String> |
getOptionNames()
Return the set of all option arguments present on the command line. |
java.util.List<java.lang.String> |
getOptionValues(java.lang.String optionName)
Return the list of values associated with the given option. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.Map<java.lang.String,java.util.List<java.lang.String>> optionArgs
private final java.util.List<java.lang.String> nonOptionArgs
Constructor Detail |
---|
CommandLineArgs()
Method Detail |
---|
public void addOptionArg(java.lang.String optionName, java.lang.String optionValue)
null
, indicating that the option was specified
without an associated value (e.g. "--foo" vs. "--foo=bar").
public java.util.Set<java.lang.String> getOptionNames()
public boolean containsOption(java.lang.String optionName)
public java.util.List<java.lang.String> getOptionValues(java.lang.String optionName)
null
signifies
that the option was not present; empty list signifies that no values were associated
with this option.
public void addNonOptionArg(java.lang.String value)
public java.util.List<java.lang.String> getNonOptionArgs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |