Package net.shibboleth.ext.spring.cli
Class AbstractCommandLineArguments
java.lang.Object
net.shibboleth.ext.spring.cli.AbstractCommandLineArguments
- All Implemented Interfaces:
CommandLineArguments
public abstract class AbstractCommandLineArguments extends Object implements CommandLineArguments
Command line arguments base class for the
AbstractCommandLine
class.-
Field Summary
Fields Modifier and Type Field Description private boolean
ansi
Use ANSI color codes.private boolean
help
Help has been requested.private String
languageRanges
RFC4647 language ranges.private String
logConfig
Name of a specific logging configuration, if one has been requested.private List<String>
otherArgs
Command-line arguments which are not part of options.private List<String>
propertySources
Spring property sources.private boolean
quiet
Quiet logging has been requested.private boolean
verbose
Verbose logging has been requested.private boolean
version
Version has been requested. -
Constructor Summary
Constructors Constructor Description AbstractCommandLineArguments()
-
Method Summary
Modifier and Type Method Description List<Locale.LanguageRange>
getLanguageRanges()
Get the specified RFC4647 language ranges.abstract org.slf4j.Logger
getLog()
Get the logger for this class.String
getLoggingConfiguration()
Gets the name of the requested logging configuration file from the command line.List<String>
getOtherArgs()
Get unparsed arguments.List<String>
getPropertyFiles()
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
isQuietOutput()
Indicates the presence of the--quiet
option.boolean
isVerboseOutput()
Indicates the presence of the--verbose
option.boolean
isVersion()
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
-