Package net.shibboleth.shared.cli
Class AbstractCommandLineArguments
java.lang.Object
net.shibboleth.shared.cli.AbstractCommandLineArguments
- All Implemented Interfaces:
CommandLineArguments
Command line arguments base class for the
AbstractCommandLine class.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanUse ANSI color codes.private booleanHelp has been requested.private StringRFC4647 language ranges.private StringName of a specific logging configuration, if one has been requested.Command-line arguments which are not part of options.Spring property sources.private booleanQuiet logging has been requested.private booleanVerbose logging has been requested.private booleanVersion has been requested. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the specified RFC4647 language ranges.abstract org.slf4j.LoggergetLog()Get the logger for this class.Gets the name of the requested logging configuration file from the command line.Get unparsed arguments.Get list of property filenames to load.booleanisANSI()Indicates the presence of the--ansioption.booleanisHelp()Indicates the presence of the--helpoption.booleanIndicates the presence of the--quietoption.booleanIndicates the presence of the--verboseoption.booleanIndicates the presence of the--versionoption.voidprintHelp(PrintStream out) Print default command line help instructions.voidvalidate()Validate the parameter set.
-
Field Details
-
otherArgs
Command-line arguments which are not part of options. -
verbose
private boolean verboseVerbose logging has been requested. -
quiet
private boolean quietQuiet logging has been requested. -
logConfig
Name of a specific logging configuration, if one has been requested. -
help
private boolean helpHelp has been requested. -
version
private boolean versionVersion has been requested. -
ansi
private boolean ansiUse ANSI color codes. -
propertySources
Spring property sources. -
languageRanges
RFC4647 language ranges.
-
-
Constructor Details
-
AbstractCommandLineArguments
public AbstractCommandLineArguments()
-
-
Method Details
-
getLog
@Nonnull public abstract org.slf4j.Logger getLog()Get the logger for this class. This has to be lazy-instantiated otherwise the auto-logging-level fails.- Returns:
- The logger to use
-
isVerboseOutput
public boolean isVerboseOutput()Indicates the presence of the--verboseoption.- Specified by:
isVerboseOutputin interfaceCommandLineArguments- Returns:
trueif the user requested verbose logging.
-
isQuietOutput
public boolean isQuietOutput()Indicates the presence of the--quietoption.- Specified by:
isQuietOutputin interfaceCommandLineArguments- Returns:
trueif the user requested quiet logging.
-
getLoggingConfiguration
Gets the name of the requested logging configuration file from the command line.- Specified by:
getLoggingConfigurationin interfaceCommandLineArguments- Returns:
- the logging configuration file name, or
null.
-
isHelp
public boolean isHelp()Indicates the presence of the--helpoption.- Specified by:
isHelpin interfaceCommandLineArguments- Returns:
trueif the user requested help.
-
isVersion
public boolean isVersion()Indicates the presence of the--versionoption.- Specified by:
isVersionin interfaceCommandLineArguments- Returns:
trueif the user requested the version be printed
-
isANSI
public boolean isANSI()Indicates the presence of the--ansioption.- Specified by:
isANSIin interfaceCommandLineArguments- Returns:
trueif the user requested the ANSI code option
-
getPropertyFiles
Get list of property filenames to load.- Specified by:
getPropertyFilesin interfaceCommandLineArguments- Returns:
- property filenames
-
getLanguageRanges
Get the specified RFC4647 language ranges.- Returns:
- language ranges
-
getOtherArgs
Get unparsed arguments.- Specified by:
getOtherArgsin interfaceCommandLineArguments- Returns:
- unparsed arguments
-
validate
Validate the parameter set.- Specified by:
validatein interfaceCommandLineArguments- Throws:
IllegalArgumentException- if the parameters are invalid
-
printHelp
Print default command line help instructions.- Specified by:
printHelpin interfaceCommandLineArguments- Parameters:
out- location where to print the output
-