public final class ArgumentGroupImpl extends Object implements ArgumentGroup, MutuallyExclusiveGroup
Constructor and Description |
---|
ArgumentGroupImpl(ArgumentParserImpl argumentParser,
String title) |
Modifier and Type | Method and Description |
---|---|
ArgumentImpl |
addArgument(String... nameOrFlags)
Creates new
Argument and adds it to the underlining parser and
returns it. |
ArgumentGroupImpl |
description(String description)
Sets description to customize help message of this group.
|
List<ArgumentImpl> |
getArgs() |
int |
getIndex() |
boolean |
isMutex() |
boolean |
isRequired() |
boolean |
isSeparateHelp()
Returns true if the help message for this group should be in separate
group.
|
void |
printHelp(PrintWriter writer,
int format_width) |
ArgumentGroupImpl |
required(boolean required)
If
true is given, one of the arguments in this group must be
specified otherwise error will be issued. |
void |
setIndex(int index) |
void |
setMutex(boolean mutex) |
public ArgumentGroupImpl(ArgumentParserImpl argumentParser, String title)
public ArgumentGroupImpl description(String description)
ArgumentGroup
description
in interface ArgumentGroup
description
in interface MutuallyExclusiveGroup
description
- The description of this group.public ArgumentImpl addArgument(String... nameOrFlags)
ArgumentGroup
Creates new Argument
and adds it to the underlining parser and
returns it.
See ArgumentParser.addArgument(String...)
for details.
addArgument
in interface ArgumentGroup
addArgument
in interface MutuallyExclusiveGroup
nameOrFlags
- A name or a list of option strings of new Argument
.Argument
object.public ArgumentGroupImpl required(boolean required)
MutuallyExclusiveGroup
If true
is given, one of the arguments in this group must be
specified otherwise error will be issued.
The default value is false
.
required
in interface MutuallyExclusiveGroup
required
- true
or false
public void printHelp(PrintWriter writer, int format_width)
public int getIndex()
public void setIndex(int index)
public boolean isMutex()
public void setMutex(boolean mutex)
public boolean isRequired()
public List<ArgumentImpl> getArgs()
public boolean isSeparateHelp()
Copyright © 2012–2017. All rights reserved.