|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rj.tools.argumentprocessor.ArgProcessor
ArgProcessor
is a generic argument processor for single character options
to be passed in into a command line program.
The usage is inspired by Perls option handling
Constructor Summary | |
ArgProcessor()
|
Method Summary | |
void |
defineOptions(java.lang.String definitions)
defineOptions - with this method the allowed arguments are defined. |
java.lang.String |
getArgumentOption(java.lang.String option)
getArgumentOption - returns the value or the option |
java.lang.String[] |
getArguments()
getArguments - returns the real arguments; the command arguments |
boolean |
hasFlagOption(java.lang.String option)
hasFlagOption - returns if the flag option is set |
boolean |
hasOption(java.lang.String option)
hasOption - check if a certain option exists; the option can either be
a flag or an option with a value |
static void |
main(java.lang.String[] args)
main for command line testing purpose |
void |
putArguments(java.lang.String options)
putArguments - put a string containing all options and arguments separated by a
white space into the ArgumentProcessor |
void |
putArguments(java.lang.String[] options)
putArguments - put an array of options and arguments into the
ArgurmentProcessor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArgProcessor()
Method Detail |
public static void main(java.lang.String[] args)
main
for command line testing purpose
args
- a String[]
valuepublic void defineOptions(java.lang.String definitions)
defineOptions
- with this method the allowed arguments are defined. They are passed
in one String. Arguments can be a trigger or have an associated argument value. Those one with a
value have are followed by a ':'A
definitions
- a String
valuepublic void putArguments(java.lang.String[] options)
putArguments
- put an array of options and arguments into the
ArgurmentProcessor. The array of options are concatenated into a long Sring --
then putArguments(String) is called
options
- a String[]
valuepublic void putArguments(java.lang.String options)
putArguments
- put a string containing all options and arguments separated by a
white space into the ArgumentProcessor
options
- a String
valuepublic boolean hasOption(java.lang.String option)
hasOption
- check if a certain option exists; the option can either be
a flag or an option with a value
option
- a String
value
boolean
valuepublic boolean hasFlagOption(java.lang.String option)
hasFlagOption
- returns if the flag option is set
option
- a String
value
boolean
valuepublic java.lang.String getArgumentOption(java.lang.String option)
getArgumentOption
- returns the value or the option
option
- a String
value
String
valuepublic java.lang.String[] getArguments()
getArguments
- returns the real arguments; the command arguments
String[]
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |