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)
ArgumentGroupdescription in interface ArgumentGroupdescription in interface MutuallyExclusiveGroupdescription - 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 ArgumentGroupaddArgument in interface MutuallyExclusiveGroupnameOrFlags - 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 MutuallyExclusiveGrouprequired - true or falsepublic 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–2025. All rights reserved.