Class AbstractOption

java.lang.Object
org.apache.rat.tools.AbstractOption
Direct Known Subclasses:
AntOption, MavenOption

public abstract class AbstractOption extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final String
    The Maven name for the option
    protected final org.apache.commons.cli.Option
    The CLI that the Maven option is wrapping
    protected static final Pattern
    The pattern to match CLI options in text
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    Replaces CLI pattern options with Maven pattern options.
    protected abstract String
    cleanupName(org.apache.commons.cli.Option option)
     
    final String
    Gets the argument name if there is one.
    Return default value.
    final String
    Gets the deprecated string if the option is deprecated, or an empty string otherwise.
    final String
    Gets the description escaped for XML format.
    final String
    Gets the Maven name for the CLI option.
    final Class<?>
    Gets the simple class name for the data type for this option.
    final boolean
    Determine if the enclosed option expects an argument.
    final boolean
    Returns true if the option has multiple arguments.
    final boolean
    Determines if the option is deprecated.
    final boolean
    Determines if the option is required.
    final String
    The key value for the option.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PATTERN

      protected static final Pattern PATTERN
      The pattern to match CLI options in text
    • option

      protected final org.apache.commons.cli.Option option
      The CLI that the Maven option is wrapping
    • name

      protected final String name
      The Maven name for the option
  • Method Details

    • getDefaultValue

      public String getDefaultValue()
      Return default value.
      Returns:
      default value or null if no argument given.
    • cleanupName

      protected abstract String cleanupName(org.apache.commons.cli.Option option)
    • cleanup

      protected String cleanup(String str)
      Replaces CLI pattern options with Maven pattern options.
      Parameters:
      str - the string to clean.
      Returns:
      the string with CLI names replaced with Maven names.
    • getName

      public final String getName()
      Gets the Maven name for the CLI option.
      Returns:
      The Maven name for the CLI option.
    • getDescription

      public final String getDescription()
      Gets the description escaped for XML format.
      Returns:
      the description or an empty string.
    • getType

      public final Class<?> getType()
      Gets the simple class name for the data type for this option. Normally "String".
      Returns:
      the simple class name for the type.
    • getArgName

      public final String getArgName()
      Gets the argument name if there is one.
      Returns:
      the Argument name
    • isDeprecated

      public final boolean isDeprecated()
      Determines if the option is deprecated.
      Returns:
      true if the option is deprecated
    • isRequired

      public final boolean isRequired()
      Determines if the option is required.
      Returns:
      true if the option is required.
    • hasArg

      public final boolean hasArg()
      Determine if the enclosed option expects an argument.
      Returns:
      true if the enclosed option expects at least one argument.
    • hasArgs

      public final boolean hasArgs()
      Returns true if the option has multiple arguments.
      Returns:
      true if the option has multiple arguments.
    • keyValue

      public final String keyValue()
      The key value for the option.
      Returns:
      the key value for the CLI argument map.
    • getDeprecated

      public final String getDeprecated()
      Gets the deprecated string if the option is deprecated, or an empty string otherwise.
      Returns:
      the deprecated string if the option is deprecated, or an empty string otherwise.