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 theAbstractCommandLineclass.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanansiUse ANSI color codes.private booleanhelpHelp has been requested.private StringlanguageRangesRFC4647 language ranges.private StringlogConfigName of a specific logging configuration, if one has been requested.private List<String>otherArgsCommand-line arguments which are not part of options.private List<String>propertySourcesSpring property sources.private booleanquietQuiet logging has been requested.private booleanverboseVerbose logging has been requested.private booleanversionVersion has been requested.
-
Constructor Summary
Constructors Constructor Description AbstractCommandLineArguments()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<Locale.LanguageRange>getLanguageRanges()Get the specified RFC4647 language ranges.abstract org.slf4j.LoggergetLog()Get the logger for this class.StringgetLoggingConfiguration()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.booleanisANSI()Indicates the presence of the--ansioption.booleanisHelp()Indicates the presence of the--helpoption.booleanisQuietOutput()Indicates the presence of the--quietoption.booleanisVerboseOutput()Indicates the presence of the--verboseoption.booleanisVersion()Indicates the presence of the--versionoption.voidprintHelp(PrintStream out)Print default command line help instructions.voidvalidate()Validate the parameter set.
-
-
-
Field Detail
-
otherArgs
@Nonnull private List<String> otherArgs
Command-line arguments which are not part of options.
-
verbose
private boolean verbose
Verbose logging has been requested.
-
quiet
private boolean quiet
Quiet logging has been requested.
-
logConfig
@Nullable private String logConfig
Name of a specific logging configuration, if one has been requested.
-
help
private boolean help
Help has been requested.
-
version
private boolean version
Version has been requested.
-
ansi
private boolean ansi
Use ANSI color codes.
-
propertySources
@Nonnull @NonnullElements private List<String> propertySources
Spring property sources.
-
languageRanges
@Nullable private String languageRanges
RFC4647 language ranges.
-
-
Method Detail
-
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
@Nullable public String 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
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<String> getPropertyFiles()
Get list of property filenames to load.- Specified by:
getPropertyFilesin interfaceCommandLineArguments- Returns:
- property filenames
-
getLanguageRanges
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<Locale.LanguageRange> getLanguageRanges()
Get the specified RFC4647 language ranges.- Returns:
- language ranges
-
getOtherArgs
@Nonnull @Unmodifiable @NotLive public List<String> getOtherArgs()
Get unparsed arguments.- Specified by:
getOtherArgsin interfaceCommandLineArguments- Returns:
- unparsed arguments
-
validate
public void validate() throws IllegalArgumentExceptionValidate the parameter set.- Specified by:
validatein interfaceCommandLineArguments- Throws:
IllegalArgumentException- if the parameters are invalid
-
printHelp
public void printHelp(PrintStream out)
Print default command line help instructions.- Specified by:
printHelpin interfaceCommandLineArguments- Parameters:
out- location where to print the output
-
-