|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjoptsimple.OptionSpecBuilder
public class OptionSpecBuilder
Wraps an option specification, and allows callers to specify whether the option accepts arguments (required or optional).
Instances are returned from OptionParser.accepts(String)
to allow the
formation of parser directives as sentences in a domain-specific language. For
example:
OptionParser parser = new OptionParser();
parser.accepts( "c" ).withRequiredArg().ofType( Integer.class );
If no methods are invoked on an instance of this class, then that instance's option will accept no argument.
Field Summary | |
---|---|
private java.lang.String |
description
|
private java.util.List |
options
|
private OptionParser |
parser
|
Constructor Summary | |
---|---|
OptionSpecBuilder(OptionParser parser,
java.util.List options,
java.lang.String description)
|
Method Summary | |
---|---|
ArgumentAcceptingOptionSpec |
withOptionalArg()
Informs an option parser that this builder's option accepts an optional argument. |
ArgumentAcceptingOptionSpec |
withRequiredArg()
Informs an option parser that this builder's option requires an argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final OptionParser parser
private final java.util.List options
private final java.lang.String description
Constructor Detail |
---|
OptionSpecBuilder(OptionParser parser, java.util.List options, java.lang.String description)
Method Detail |
---|
public ArgumentAcceptingOptionSpec withRequiredArg()
Informs an option parser that this builder's option requires an argument.
public ArgumentAcceptingOptionSpec withOptionalArg()
Informs an option parser that this builder's option accepts an optional argument.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |