|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectCommonParser
ParamParser
public class ParamParser
This class parses the command line configuration options. The developer can add a set of parameters which are parsed by the this class. The parsed values are then made accessible via getter methods.
| Constructor Summary | |
|---|---|
ParamParser()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addParam(Param param)
This method is used to add a new parameter that should be handled by the parser. |
String |
getDefaultValue(String key)
This method returns the default value for the given key. |
String |
getValue(String key)
This method returns the corresponding value for the given key. |
boolean |
isPresent(String key)
This method returns true if the given key is present (i.e. |
void |
parse(String[] args)
This method parses the the given command line arguments. |
void |
parse(String[] args,
int offset)
This method parses the the given command line arguments. |
void |
printUsage()
This method prints the usage message of the application. |
| Methods inherited from class Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParamParser()
| Method Detail |
|---|
public void addParam(Param param)
param - new command line parameter
public void parse(String[] args)
throws IllegalArgumentException
args - The command line arguments to be parsed.
IllegalArgumentException
public void parse(String[] args,
int offset)
throws IllegalArgumentException
args - The command line arguments to be parsed.offset - This defines an offset where to start parsing the args parameter.
IllegalArgumentExceptionpublic String getValue(String key)
key -
public String getDefaultValue(String key)
key -
public boolean isPresent(String key)
key -
public void printUsage()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||