Package net.shibboleth.ext.spring.cli
Class AbstractCommandLineArguments
java.lang.Object
net.shibboleth.ext.spring.cli.AbstractCommandLineArguments
- All Implemented Interfaces:
CommandLineArguments
Command line arguments base class for the
AbstractCommandLine
class.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Use ANSI color codes.private boolean
Help has been requested.private String
RFC4647 language ranges.private String
Name of a specific logging configuration, if one has been requested.Command-line arguments which are not part of options.Spring property sources.private boolean
Quiet logging has been requested.private boolean
Verbose logging has been requested.private boolean
Version has been requested. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the specified RFC4647 language ranges.abstract org.slf4j.Logger
getLog()
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.boolean
isANSI()
Indicates the presence of the--ansi
option.boolean
isHelp()
Indicates the presence of the--help
option.boolean
Indicates the presence of the--quiet
option.boolean
Indicates the presence of the--verbose
option.boolean
Indicates the presence of the--version
option.void
printHelp
(PrintStream out) Print default command line help instructions.void
validate()
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--verbose
option.- Specified by:
isVerboseOutput
in interfaceCommandLineArguments
- Returns:
true
if the user requested verbose logging.
-
isQuietOutput
public boolean isQuietOutput()Indicates the presence of the--quiet
option.- Specified by:
isQuietOutput
in interfaceCommandLineArguments
- Returns:
true
if the user requested quiet logging.
-
getLoggingConfiguration
Gets the name of the requested logging configuration file from the command line.- Specified by:
getLoggingConfiguration
in interfaceCommandLineArguments
- Returns:
- the logging configuration file name, or
null
.
-
isHelp
public boolean isHelp()Indicates the presence of the--help
option.- Specified by:
isHelp
in interfaceCommandLineArguments
- Returns:
true
if the user requested help.
-
isVersion
public boolean isVersion()Indicates the presence of the--version
option.- Specified by:
isVersion
in interfaceCommandLineArguments
- Returns:
true
if the user requested the version be printed
-
isANSI
public boolean isANSI()Indicates the presence of the--ansi
option.- Specified by:
isANSI
in interfaceCommandLineArguments
- Returns:
true
if the user requested the ANSI code option
-
getPropertyFiles
Get list of property filenames to load.- Specified by:
getPropertyFiles
in interfaceCommandLineArguments
- Returns:
- property filenames
-
getLanguageRanges
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<Locale.LanguageRange> getLanguageRanges()Get the specified RFC4647 language ranges.- Returns:
- language ranges
-
getOtherArgs
Get unparsed arguments.- Specified by:
getOtherArgs
in interfaceCommandLineArguments
- Returns:
- unparsed arguments
-
validate
Validate the parameter set.- Specified by:
validate
in interfaceCommandLineArguments
- Throws:
IllegalArgumentException
- if the parameters are invalid
-
printHelp
Print default command line help instructions.- Specified by:
printHelp
in interfaceCommandLineArguments
- Parameters:
out
- location where to print the output
-