Class AbstractOptionCheck<T extends java.lang.Enum<T>>

  • Type Parameters:
    T - the type of the option.
    All Implemented Interfaces:
    Configurable, Contextualizable

    @Deprecated
    public abstract class AbstractOptionCheck<T extends java.lang.Enum<T>>
    extends AbstractCheck
    Deprecated.
    Checkstyle will not support abstract checks anymore. Use AbstractCheck instead.
    Abstract class for checks with a parameter named option, where the option is identified by a Enum. The logic to convert from a string representation to the Enum is to String.trim() the string and convert using String.toUpperCase() and then look up using Enum.valueOf(java.lang.Class<T>, java.lang.String).
    • Field Detail

      • SEMICOLON

        protected static final java.lang.String SEMICOLON
        Deprecated.
        Semicolon literal.
        See Also:
        Constant Field Values
      • optionClass

        private final java.lang.Class<T extends java.lang.Enum<T>> optionClass
        Deprecated.
        Since I cannot get this by going T.class.
      • abstractOption

        private T extends java.lang.Enum<T> abstractOption
        Deprecated.
        The policy to enforce.
    • Constructor Detail

      • AbstractOptionCheck

        protected AbstractOptionCheck​(T literalDefault,
                                      java.lang.Class<T> optionClass)
        Deprecated.
        Creates a new AbstractOptionCheck instance.
        Parameters:
        literalDefault - the default option.
        optionClass - the class for the option. Required due to a quirk in the Java language.
    • Method Detail

      • setOption

        public void setOption​(java.lang.String optionStr)
        Deprecated.
        Set the option to enforce.
        Parameters:
        optionStr - string to decode option from
        Throws:
        java.lang.IllegalArgumentException - if unable to decode
      • getAbstractOption

        public T getAbstractOption()
        Deprecated.
        Gets AbstractOption set.
        Returns:
        the AbstractOption set