Class UniquePropertiesCheck

    • Field Detail

      • MSG_KEY

        public static final java.lang.String MSG_KEY
        Localization key for check violation.
        See Also:
        Constant Field Values
      • MSG_IO_EXCEPTION_KEY

        public static final java.lang.String MSG_IO_EXCEPTION_KEY
        Localization key for IO exception occurred on file open.
        See Also:
        Constant Field Values
      • SPACE_PATTERN

        private static final java.util.regex.Pattern SPACE_PATTERN
        Pattern matching single space.
    • Constructor Detail

      • UniquePropertiesCheck

        public UniquePropertiesCheck()
        Construct the check with default values.
    • Method Detail

      • 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.
      • getLineNumber

        protected static int getLineNumber​(java.util.List<java.lang.String> lines,
                                           java.lang.String keyName)
        Method returns line number the key is detected in the checked properties files first.
        Parameters:
        lines - properties file lines list
        keyName - key name to look for
        Returns:
        line number of first occurrence. If no key found in properties file, 0 is returned