Package net.shibboleth.shared.cli

# Class AbstractCommandLineArguments

java.lang.Object
net.shibboleth.shared.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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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 private List<String> propertySources
Spring property sources.

### languageRanges

@Nullable private String 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 interface `CommandLineArguments`
Returns:
  `true` if the user requested verbose logging.

### isQuietOutput

public boolean isQuietOutput()
Indicates the presence of the `--quiet` option.

Specified by:
  `isQuietOutput` in interface `CommandLineArguments`
Returns:
  `true` if 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:
  `getLoggingConfiguration` in interface `CommandLineArguments`
Returns:
  the logging configuration file name, or `null`.

### isHelp

public boolean isHelp()
Indicates the presence of the `--help` option.

Specified by:
  `isHelp` in interface `CommandLineArguments`
Returns:
  `true` if the user requested help.

### isVersion

public boolean isVersion()
Indicates the presence of the `--version` option.

Specified by:
  `isVersion` in interface `CommandLineArguments`
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 interface `CommandLineArguments`
Returns:
  `true` if the user requested the ANSI code option

### getPropertyFiles

@Nonnull @Unmodifiable @NotLive public List<String> getPropertyFiles()
Get list of property filenames to load.

Specified by:
  `getPropertyFiles` in interface `CommandLineArguments`
Returns:
  property filenames

### getLanguageRanges

@Nonnull @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:
  `getOtherArgs` in interface `CommandLineArguments`
Returns:
  unparsed arguments

### validate

public void validate() throws IllegalArgumentException
Validate the parameter set.

Specified by:
  `validate` in interface `CommandLineArguments`
Throws:
  `IllegalArgumentException` - if the parameters are invalid

### printHelp

public void printHelp(@Nonnull PrintStream out)
Print default command line help instructions.

Specified by:
  `printHelp` in interface `CommandLineArguments`
Parameters:
  `out` - location where to print the output