|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.CommandLineParser
util.PropertyParser
public class PropertyParser
A class that allows reading of command line switches and parsing them
into Maps. This makes only sense for one-parameter switches. To
avoid awkward-long command line switches, a mapping of short names to
property keys can be provided on the retrieval methods.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.CommandLineParser |
|---|
CommandLineParser.Test |
| Field Summary | |
|---|---|
private Map<String,String> |
argprop
Mapping from command line arguments to property keys. |
| Constructor Summary | |
|---|---|
PropertyParser(Map<String,String> tolong)
Constructs a property parser where the argumental map links short names to property keys. |
|
| Method Summary | |
|---|---|
static Map<String,String> |
parseMap(String[] commandline,
Map<String,String> tolong,
Map<String,String> in)
Retrieves a map consisting of the given parameter switches. |
static Map<String,String> |
parseMap(String[] commandline,
Map<String,String> tolong,
Map<String,String> in,
PrintWriter out)
Retrieves a map consisting of the given parameter switches. |
Map<String,String> |
parseProperties(Map<String,String> in)
Parses the command lines and additionally returns the properties parsed |
Map<String,String> |
parseProperties(PrintWriter out)
Parses the command lines and additionally returns the properties parsed |
Map<String,String> |
parseProperties(PrintWriter out,
Map<String,String> in)
Parses the command lines and additionally returns the properties parsed |
private static Map<String,String> |
parseToProperties(PropertyParser aux,
PrintWriter out,
Map<String,String> in)
Retrieves a map consisting of the given parameter switches. |
| Methods inherited from class util.CommandLineParser |
|---|
getArguments, getCommandLine, getCommands, getRegisteredSwitches, hasAnySwitch, hasSwitch, hasSwitch, haveAllSwitches, parse, printCommandLine, registerLine, registerSwitches, setCommands, staticUsage, usage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Map<String,String> argprop
| Constructor Detail |
|---|
public PropertyParser(Map<String,String> tolong)
| Method Detail |
|---|
public Map<String,String> parseProperties(PrintWriter out)
public Map<String,String> parseProperties(PrintWriter out,
Map<String,String> in)
public Map<String,String> parseProperties(Map<String,String> in)
in - Default properties or null. Overriden with actually parsed
ones.
public static Map<String,String> parseMap(String[] commandline,
Map<String,String> tolong,
Map<String,String> in)
throws ParseException
tolong - Keys are the command line switches, values the property
key names.in - Default properties or null. Overriden with actually parsed
ones.
ParseException
public static Map<String,String> parseMap(String[] commandline,
Map<String,String> tolong,
Map<String,String> in,
PrintWriter out)
throws ParseException
tolong - Keys are the command line switches, values the property
key names.in - Default properties or null. Overriden with actually parsed
ones.
ParseException
private static Map<String,String> parseToProperties(PropertyParser aux,
PrintWriter out,
Map<String,String> in)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||