Class HeaderCheck

    • Field Detail

      • MSG_MISSING

        public static final java.lang.String MSG_MISSING
        A key is pointing to the warning message text in "messages.properties" file.
        See Also:
        Constant Field Values
      • MSG_MISMATCH

        public static final java.lang.String MSG_MISMATCH
        A key is pointing to the warning message text in "messages.properties" file.
        See Also:
        Constant Field Values
      • EMPTY_INT_ARRAY

        private static final int[] EMPTY_INT_ARRAY
        Empty array to avoid instantiations.
      • ignoreLines

        private int[] ignoreLines
        The header lines to ignore in the check, sorted.
    • Constructor Detail

      • HeaderCheck

        public HeaderCheck()
    • Method Detail

      • isIgnoreLine

        private boolean isIgnoreLine​(int lineNo)
        Returns true if lineNo is header lines or false.
        Parameters:
        lineNo - a line number
        Returns:
        if lineNo is one of the ignored header lines.
      • isMatch

        protected boolean isMatch​(int lineNumber,
                                  java.lang.String line)
        Checks if a code line matches the required header line.
        Parameters:
        lineNumber - the line number to check against the header
        line - the line contents
        Returns:
        true if and only if the line matches the required header line
      • setIgnoreLines

        public void setIgnoreLines​(int... list)
        Set the lines numbers to ignore in the header check.
        Parameters:
        list - comma separated list of line numbers to ignore in header.
      • processFiltered

        protected void processFiltered​(java.io.File file,
                                       java.util.List<java.lang.String> lines)
        Description copied from class: AbstractFileSetCheck
        Called to process a file that matches the specified file extensions.
        Specified by:
        processFiltered in class AbstractFileSetCheck
        Parameters:
        file - the file to be processed
        lines - an immutable list of the contents of the file.