Class AbstractFormatCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    @Deprecated
    public abstract class AbstractFormatCheck
    extends AbstractCheck
    Deprecated.
    Checkstyle will not support abstract checks anymore. Use AbstractCheck instead.

    Abstract class for checks that verify strings using a regular expression. It provides support for setting the regular expression using the property name format.

    • Field Detail

      • compileFlags

        private int compileFlags
        Deprecated.
        The flags to create the regular expression with.
      • regexp

        private java.util.regex.Pattern regexp
        Deprecated.
        The regexp to match against.
      • format

        private java.lang.String format
        Deprecated.
        The format string of the regexp.
    • Constructor Detail

      • AbstractFormatCheck

        protected AbstractFormatCheck​(java.lang.String defaultFormat)
        Deprecated.
        Creates a new AbstractFormatCheck instance. Defaults the compile flag to 0 (the default).
        Parameters:
        defaultFormat - default format
        Throws:
        org.apache.commons.beanutils.ConversionException - unable to parse defaultFormat
      • AbstractFormatCheck

        protected AbstractFormatCheck​(java.lang.String defaultFormat,
                                      int compileFlags)
        Deprecated.
        Creates a new AbstractFormatCheck instance.
        Parameters:
        defaultFormat - default format
        compileFlags - the Pattern flags to compile the regexp with. See Pattern.compile(String, int)
        Throws:
        org.apache.commons.beanutils.ConversionException - unable to parse defaultFormat
    • Method Detail

      • setFormat

        public final void setFormat​(java.lang.String format)
        Deprecated.
        Set the format to the specified regular expression.
        Parameters:
        format - a String value
        Throws:
        org.apache.commons.beanutils.ConversionException - unable to parse format
      • setCompileFlags

        public final void setCompileFlags​(int compileFlags)
        Deprecated.
        Set the compile flags for the regular expression.
        Parameters:
        compileFlags - the compile flags to use.
      • getRegexp

        public final java.util.regex.Pattern getRegexp()
        Deprecated.
        Gets the regexp.
        Returns:
        the regexp to match against
      • getFormat

        public final java.lang.String getFormat()
        Deprecated.
        Gets the regexp format.
        Returns:
        the regexp format
      • updateRegexp

        private void updateRegexp​(java.lang.String regexpFormat,
                                  int compileFlagsParam)
        Deprecated.
        Updates the regular expression using the supplied format and compiler flags. Will also update the member variables.
        Parameters:
        regexpFormat - the format of the regular expression.
        compileFlagsParam - the compiler flags to use.