Class ArgumentGroupImpl
java.lang.Object
net.sourceforge.argparse4j.internal.ArgumentGroupImpl
- All Implemented Interfaces:
ArgumentGroup
,MutuallyExclusiveGroup
public final class ArgumentGroupImpl
extends Object
implements ArgumentGroup, MutuallyExclusiveGroup
The application code must not use this class directly.
This class implements both mutually exclusive group and just a conceptual
group.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddArgument
(String... nameOrFlags) Creates newArgument
and adds it to the underlining parser and returns it.description
(String description) Sets description to customize help message of this group.getArgs()
int
getIndex()
boolean
isMutex()
boolean
boolean
Returns true if the help message for this group should be in separate group.void
printHelp
(PrintWriter writer, int format_width) required
(boolean required) Iftrue
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)
-
Constructor Details
-
ArgumentGroupImpl
-
-
Method Details
-
description
Description copied from interface:ArgumentGroup
Sets description to customize help message of this group.- Specified by:
description
in interfaceArgumentGroup
- Specified by:
description
in interfaceMutuallyExclusiveGroup
- Parameters:
description
- The description of this group.- Returns:
- this
-
addArgument
Description copied from interface:ArgumentGroup
Creates new
Argument
and adds it to the underlining parser and returns it.See
ArgumentParser.addArgument(String...)
for details.- Specified by:
addArgument
in interfaceArgumentGroup
- Specified by:
addArgument
in interfaceMutuallyExclusiveGroup
- Parameters:
nameOrFlags
- A name or a list of option strings of newArgument
.- Returns:
Argument
object.
-
required
Description copied from interface: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
.- Specified by:
required
in interfaceMutuallyExclusiveGroup
- Parameters:
required
-true
orfalse
- Returns:
- this
-
printHelp
-
getIndex
public int getIndex() -
setIndex
public void setIndex(int index) -
isMutex
public boolean isMutex() -
setMutex
public void setMutex(boolean mutex) -
isRequired
public boolean isRequired() -
getArgs
-
isSeparateHelp
public boolean isSeparateHelp()Returns true if the help message for this group should be in separate group.- Returns:
- true if the help message for this group should be in separate group.
-