Enum Arg

java.lang.Object
java.lang.Enum<Arg>
org.apache.rat.commandline.Arg
All Implemented Interfaces:
Serializable, Comparable<Arg>

public enum Arg extends Enum<Arg>
An enumeration of options.

Each Arg contains an OptionGroup that contains the individual options that all resolve to the same option. This allows us to deprecate options as we move forward in development.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Standard messages used in descriptions.
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Group of options that read a configuration file
    Group of options that skip the default configuration file
    Option to specify an acceptable number of various counters.
    Option to specify an acceptable number of various counters.
    Stop processing an input stream and declare an input file.
    Specifies that the run should not perform any updates to files.
    Defines options to add licenses to files
    Defines options to add copyright to files
    Causes file updates to overwrite existing files.
    Excludes files by expression
    Excludes files based on contents of a file.
    Excludes files based on SCM exclusion file processing.
    Excludes files if they are smaller than the given threshold.
    Excludes files based on standard groupings.
    Option that specifies approved license families
    Option that specifies approved license families from a file
    Option to list license families to remove from the approved list.
    Option to read a list of license families to remove from the approved list.
    Provide license definition listing of registered licenses.
    Excludes files by expression.
    Includes files based on contents of a file.
    Includes files based on standard groups.
    Option that adds approved licenses to the list
    Option that adds approved licenses from a file
    Option to remove licenses from the approved list
    Option to read a file licenses to be removed from the approved list.
    Specifies the log level to log messages at.
    Specifies the level of reporting detail for archive files.
    Specifies the license families that should be included in the output.
    Specifies where the output should be written.
    Specifies the license definitions that should be included in the output.
    Specifies the level of reporting detail for standard files.
    Defines the stylesheet to use.
    Reads files to test from file.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the default value for this arg.
    org.apache.commons.cli.Option
    find(String key)
    Finds the element associated with the key within the element group.
    static Arg
    Finds the Arg that contains an Option with the specified key.
    static Arg
    findArg(org.apache.commons.cli.Option optionToFind)
    Finds the Arg that an Option is in.
    static org.apache.commons.cli.Options
    Gets the full set of options.
    org.apache.commons.cli.Option
    Gets the select element from the group.
    org.apache.commons.cli.OptionGroup
    Gets the group for this arg.
    boolean
    Determines if the group has a selected element.
    org.apache.commons.cli.Option
    Returns the first non-deprecated option from the group.
    static void
    Process the arguments.
    static void
    processLogLevel(org.apache.commons.cli.CommandLine commandLine)
    Process the log level setting.
    static void
    Resets the groups in the Args so that they are unused and ready to detect the next set of arguments.
    static Arg
    Returns the enum constant of this type with the specified name.
    static Arg[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • EDIT_OVERWRITE

      public static final Arg EDIT_OVERWRITE
      Causes file updates to overwrite existing files.
    • EDIT_ADD

      public static final Arg EDIT_ADD
      Defines options to add licenses to files
    • CONFIGURATION

      public static final Arg CONFIGURATION
      Group of options that read a configuration file
    • CONFIGURATION_NO_DEFAULTS

      public static final Arg CONFIGURATION_NO_DEFAULTS
      Group of options that skip the default configuration file
    • LICENSES_APPROVED

      public static final Arg LICENSES_APPROVED
      Option that adds approved licenses to the list
    • LICENSES_APPROVED_FILE

      public static final Arg LICENSES_APPROVED_FILE
      Option that adds approved licenses from a file
    • FAMILIES_APPROVED

      public static final Arg FAMILIES_APPROVED
      Option that specifies approved license families
    • FAMILIES_APPROVED_FILE

      public static final Arg FAMILIES_APPROVED_FILE
      Option that specifies approved license families from a file
    • LICENSES_DENIED

      public static final Arg LICENSES_DENIED
      Option to remove licenses from the approved list
    • LICENSES_DENIED_FILE

      public static final Arg LICENSES_DENIED_FILE
      Option to read a file licenses to be removed from the approved list.
    • FAMILIES_DENIED

      public static final Arg FAMILIES_DENIED
      Option to list license families to remove from the approved list.
    • FAMILIES_DENIED_FILE

      public static final Arg FAMILIES_DENIED_FILE
      Option to read a list of license families to remove from the approved list.
    • COUNTER_MAX

      public static final Arg COUNTER_MAX
      Option to specify an acceptable number of various counters.
    • COUNTER_MIN

      public static final Arg COUNTER_MIN
      Option to specify an acceptable number of various counters.
    • SOURCE

      public static final Arg SOURCE
      Reads files to test from file.
    • EXCLUDE

      public static final Arg EXCLUDE
      Excludes files by expression
    • EXCLUDE_FILE

      public static final Arg EXCLUDE_FILE
      Excludes files based on contents of a file.
    • EXCLUDE_STD

      public static final Arg EXCLUDE_STD
      Excludes files based on standard groupings.
    • EXCLUDE_SIZE

      public static final Arg EXCLUDE_SIZE
      Excludes files if they are smaller than the given threshold.
    • INCLUDE

      public static final Arg INCLUDE
      Excludes files by expression.
    • INCLUDE_FILE

      public static final Arg INCLUDE_FILE
      Includes files based on contents of a file.
    • INCLUDE_STD

      public static final Arg INCLUDE_STD
      Includes files based on standard groups.
    • EXCLUDE_PARSE_SCM

      public static final Arg EXCLUDE_PARSE_SCM
      Excludes files based on SCM exclusion file processing.
    • DIR

      public static final Arg DIR
      Stop processing an input stream and declare an input file.
    • OUTPUT_STYLE

      public static final Arg OUTPUT_STYLE
      Defines the stylesheet to use.
    • OUTPUT_LICENSES

      public static final Arg OUTPUT_LICENSES
      Specifies the license definitions that should be included in the output.
    • OUTPUT_FAMILIES

      public static final Arg OUTPUT_FAMILIES
      Specifies the license families that should be included in the output.
    • LOG_LEVEL

      public static final Arg LOG_LEVEL
      Specifies the log level to log messages at.
    • DRY_RUN

      public static final Arg DRY_RUN
      Specifies that the run should not perform any updates to files.
    • OUTPUT_FILE

      public static final Arg OUTPUT_FILE
      Specifies where the output should be written.
    • OUTPUT_ARCHIVE

      public static final Arg OUTPUT_ARCHIVE
      Specifies the level of reporting detail for archive files.
    • OUTPUT_STANDARD

      public static final Arg OUTPUT_STANDARD
      Specifies the level of reporting detail for standard files.
    • HELP_LICENSES

      public static final Arg HELP_LICENSES
      Provide license definition listing of registered licenses.
  • Method Details

    • values

      public static Arg[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Arg valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • isSelected

      public boolean isSelected()
      Determines if the group has a selected element.
      Returns:
      true if the group has a selected element.
    • getSelected

      public org.apache.commons.cli.Option getSelected()
      Gets the select element from the group.
      Returns:
      the selected element or null if no element is selected.
    • find

      public org.apache.commons.cli.Option find(String key)
      Finds the element associated with the key within the element group.
      Parameters:
      key - the key to search for.
      Returns:
      the matching Option.
      Throws:
      IllegalArgumentException - if the key can not be found.
    • defaultValue

      public String defaultValue()
      Gets the default value for this arg.
      Returns:
      default value of this arg.
    • group

      public org.apache.commons.cli.OptionGroup group()
      Gets the group for this arg.
      Returns:
      the option group for this arg.
    • option

      public org.apache.commons.cli.Option option()
      Returns the first non-deprecated option from the group.
      Returns:
      the first non-deprecated option or null if no non-deprecated option is available.
    • getOptions

      public static org.apache.commons.cli.Options getOptions()
      Gets the full set of options.
      Returns:
      the full set of options for this Arg.
    • processLogLevel

      public static void processLogLevel(org.apache.commons.cli.CommandLine commandLine)
      Process the log level setting.
      Parameters:
      commandLine - The command line to process.
    • processArgs

      public static void processArgs(ArgumentContext context) throws ConfigurationException
      Process the arguments.
      Parameters:
      context - the context in which to process the args.
      Throws:
      ConfigurationException - on error
    • reset

      public static void reset()
      Resets the groups in the Args so that they are unused and ready to detect the next set of arguments.
    • findArg

      public static Arg findArg(org.apache.commons.cli.Option optionToFind)
      Finds the Arg that an Option is in.
      Parameters:
      optionToFind - the Option to locate.
      Returns:
      The Arg or null if no Arg is found.
    • findArg

      public static Arg findArg(String key)
      Finds the Arg that contains an Option with the specified key.
      Parameters:
      key - the key for the Option to locate.
      Returns:
      The Arg or null if no Arg is found.