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 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