|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limitless.util.CommandLineArgumentParser
public class CommandLineArgumentParser
This class trivializes the parsing of command-line arguments that obey the following structure: --flag - the presence of this stands alone -option value - this is an option with a single value following Anything else is an argument. Arguments are always in order. This class allows no means to determine what intermix of options, flags, and arguments there were, but the ordering relative to their same type is maintained.
| Nested Class Summary | |
|---|---|
static class |
CommandLineArgumentParser.BasicDetailsBuilder
Basic command line argument builder. |
static class |
CommandLineArgumentParser.BasicParseStrategy
|
static class |
CommandLineArgumentParser.DefaultDetailsBuilder
Default command line argument builder. |
static class |
CommandLineArgumentParser.Details
This holds the processed set of command line arguments with no leading dashes on anything. |
static interface |
CommandLineArgumentParser.DetailsBuilder
|
static class |
CommandLineArgumentParser.Option
This holds option name and value, with the leading "-" stripped from the name. |
static class |
CommandLineArgumentParser.ParseException
This exception class is used when a parse rule is violated. |
| Field Summary | |
|---|---|
private static org.apache.log4j.Logger |
logger
|
| Constructor Summary | |
|---|---|
CommandLineArgumentParser()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
main() method for testing purposes. |
CommandLineArgumentParser.Details |
parse(java.lang.String[] args)
Calls the parse() method using the default Details builder (see above) and the basic parse strategy. |
CommandLineArgumentParser.Details |
parse(java.lang.String[] args,
CommandLineArgumentParser.DetailsBuilder builder)
Calls the parse() method using the specified Details builder and the basic parse strategy. |
CommandLineArgumentParser.Details |
parse(java.lang.String[] args,
CommandLineArgumentParser.DetailsBuilder builder,
CommandLineArgumentParser.BasicParseStrategy strategy)
Call this to parse the command line arguments. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public CommandLineArgumentParser()
| Method Detail |
|---|
public CommandLineArgumentParser.Details parse(java.lang.String[] args,
CommandLineArgumentParser.DetailsBuilder builder,
CommandLineArgumentParser.BasicParseStrategy strategy)
throws CommandLineArgumentParser.ParseException
args - builder - strategy -
CommandLineArgumentParser.ParseException
public CommandLineArgumentParser.Details parse(java.lang.String[] args,
CommandLineArgumentParser.DetailsBuilder builder)
throws CommandLineArgumentParser.ParseException
args - builder -
CommandLineArgumentParser.ParseException
public CommandLineArgumentParser.Details parse(java.lang.String[] args)
throws CommandLineArgumentParser.ParseException
CommandLineArgumentParser.ParseExceptionCommandLineArgumentParser.DefaultDetailsBuilderpublic static void main(java.lang.String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||