|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.utils.CmdlineOptions
public class CmdlineOptions
INTERNAL: A class that parses command line options.
Nested Class Summary | |
---|---|
static interface |
CmdlineOptions.ListenerIF
INTERNAL: A listener interface that must be implemented by object that are interested in options found by the CmdlineOptions instance. |
static class |
CmdlineOptions.OptionsException
INTERNAL: An exception that is thrown when there are problems with the options specified on the command line. |
Field Summary | |
---|---|
protected java.lang.String |
application
|
protected java.util.List<java.lang.String> |
arguments
|
protected java.lang.String[] |
argv
|
protected java.util.List<gnu.getopt.LongOpt> |
largs
|
protected java.util.Map<java.lang.Integer,CmdlineOptions.ListenerIF> |
listeners
|
protected java.lang.StringBuffer |
sargs
|
Constructor Summary | |
---|---|
CmdlineOptions(java.lang.String application,
java.lang.String[] argv)
|
Method Summary | |
---|---|
void |
addLong(CmdlineOptions.ListenerIF listener,
java.lang.String name,
char c)
Add a long argumentless option with the specified listener. |
void |
addLong(CmdlineOptions.ListenerIF listener,
java.lang.String name,
char c,
boolean req_arg)
Add a long option with argument with the specified listener. |
void |
addShort(CmdlineOptions.ListenerIF listener,
char c)
Add a short argumentless option with the specified listener. |
void |
addShort(CmdlineOptions.ListenerIF listener,
char c,
boolean req_arg)
Add a short option with argument with the specified listener. |
java.lang.String[] |
getArguments()
Return non-option arguments that are remaining after parsing the command line arguments. |
void |
parse()
Parse the command line arguments and notify option listeners. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String application
protected java.lang.String[] argv
protected java.lang.StringBuffer sargs
protected java.util.List<gnu.getopt.LongOpt> largs
protected java.util.Map<java.lang.Integer,CmdlineOptions.ListenerIF> listeners
protected java.util.List<java.lang.String> arguments
Constructor Detail |
---|
public CmdlineOptions(java.lang.String application, java.lang.String[] argv)
Method Detail |
---|
public void addShort(CmdlineOptions.ListenerIF listener, char c)
public void addShort(CmdlineOptions.ListenerIF listener, char c, boolean req_arg)
public void addLong(CmdlineOptions.ListenerIF listener, java.lang.String name, char c)
public void addLong(CmdlineOptions.ListenerIF listener, java.lang.String name, char c, boolean req_arg)
public void parse() throws CmdlineOptions.OptionsException
CmdlineOptions.OptionsException
public java.lang.String[] getArguments()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |