|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiaik.tc.utils.cmdline.CommonParser
iaik.tc.utils.cmdline.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. |
java.lang.String |
getDefaultValue(java.lang.String key)
This method returns the default value for the given key. |
java.lang.String |
getValue(java.lang.String key)
This method returns the corresponding value for the given key. |
boolean |
isPresent(java.lang.String key)
This method returns true if the given key is present (i.e. |
void |
parse(java.lang.String[] args)
This method parses the the given command line arguments. |
void |
parse(java.lang.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 java.lang.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 parameterpublic void parse(java.lang.String[] args) throws java.lang.IllegalArgumentException
args
- The command line arguments to be parsed.
java.lang.IllegalArgumentException
public void parse(java.lang.String[] args, int offset) throws java.lang.IllegalArgumentException
args
- The command line arguments to be parsed.offset
- This defines an offset where to start parsing the args parameter.
java.lang.IllegalArgumentException
public java.lang.String getValue(java.lang.String key)
key
-
public java.lang.String getDefaultValue(java.lang.String key)
key
-
public boolean isPresent(java.lang.String key)
key
-
public void printUsage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |