Class ArgumentGroupImpl
java.lang.Object
net.sourceforge.argparse4j.internal.ArgumentGroupImpl
- All Implemented Interfaces:
ArgumentContainer, 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.
-
Method Summary
Modifier and TypeMethodDescriptionaddArgument(String... nameOrFlags) Creates newArgument, adds it to this container and returns it.description(String description) Sets the description for the arguments of this container.getArgs()booleanvoidprintHelp(PrintWriter writer, int format_width) required(boolean required) Iftrueis given, one of the arguments in this group must be specified otherwise error will be issued.
-
Method Details
-
description
Description copied from interface:ArgumentContainerSets the description for the arguments of this container.- Specified by:
descriptionin interfaceArgumentContainer- Specified by:
descriptionin interfaceArgumentGroup- Specified by:
descriptionin interfaceMutuallyExclusiveGroup- Parameters:
description- The description of this container.- Returns:
- this
-
addArgument
Description copied from interface:ArgumentContainerCreates new
Argument, adds it to this container and returns it.The
nameOrFlagsis either a single name of positional argument or a list of option strings for named argument, e.g.fooor-f, --foo.- Specified by:
addArgumentin interfaceArgumentContainer- Parameters:
nameOrFlags- A name or a list of option strings of newArgument.- Returns:
Argumentobject.
-
required
Description copied from interface:MutuallyExclusiveGroupIf
trueis given, one of the arguments in this group must be specified otherwise error will be issued.The default value is
false.- Specified by:
requiredin interfaceMutuallyExclusiveGroup- Parameters:
required-trueorfalse- Returns:
- this
-
printHelp
-
isRequired
public boolean isRequired() -
getArgs
-