Class LoggingCSSParseErrorHandler

    • Constructor Detail

      • LoggingCSSParseErrorHandler

        public LoggingCSSParseErrorHandler()
        Default constructor.
    • Method Detail

      • createLoggingStringUnexpectedRule

        @Nonnull
        @Nonempty
        public static String createLoggingStringUnexpectedRule​(@Nonnull
                                                               Token aCurrentToken,
                                                               @Nonnull @Nonempty
                                                               String sRule,
                                                               @Nonnull @Nonempty
                                                               String sMsg)
        Create a common string to be used for unexpected rules.
        Parameters:
        aCurrentToken - The current token that caused an error. Never null.
        sRule - The name of the rule. Always starts with a '@'. May neither be null nor empty.
        sMsg - The custom error message. Neither null nor empty.
        Returns:
        The concatenated string with source location, rule and message. May neither be null nor empty.
      • onCSSUnexpectedRule

        public void onCSSUnexpectedRule​(@Nonnull
                                        Token aCurrentToken,
                                        @Nonnull @Nonempty
                                        String sRule,
                                        @Nonnull @Nonempty
                                        String sMsg)
                                 throws ParseException
        Description copied from interface: ICSSParseErrorHandler
        Called upon an unexpected rule. This happens e.g. when @import is used in the middle of the file.
        Specified by:
        onCSSUnexpectedRule in interface ICSSParseErrorHandler
        Parameters:
        aCurrentToken - The token that could not be interpreted. Never null.
        sRule - The name of the rule. Always starts with a '@'. Neither null nor empty.
        sMsg - The custom error message. Neither null nor empty.
        Throws:
        ParseException - In case the error is fatal and should be propagated.
      • createLoggingStringDeprecatedProperty

        @Nonnull
        @Nonempty
        public static String createLoggingStringDeprecatedProperty​(@Nonnull
                                                                   Token aPrefixToken,
                                                                   @Nonnull
                                                                   Token aIdentifierToken)
        Create a common string to be used for deprecated properties. To be called, if a deprecated old IE 6/7 property is found.
        Parameters:
        aPrefixToken - The prefix token found (like '$' or '*'). Never null.
        aIdentifierToken - The identifier token found. Never null.
        Returns:
        The concatenated string with source location, etc. May neither be null nor empty.
        Throws:
        ParseException - In case the error is fatal and should be propagated.
      • onCSSDeprecatedProperty

        public void onCSSDeprecatedProperty​(@Nonnull
                                            Token aPrefixToken,
                                            @Nonnull
                                            Token aIdentifierToken)
        Description copied from interface: ICSSParseErrorHandler
        To be called, if a deprecated old IE 6/7 property is found.
        Specified by:
        onCSSDeprecatedProperty in interface ICSSParseErrorHandler
        Parameters:
        aPrefixToken - The prefix token found (like '$' or '*'). Never null.
        aIdentifierToken - The identifier token found. Never null.
      • createLoggingStringIllegalCharacter

        @Nonnull
        @Nonempty
        public static String createLoggingStringIllegalCharacter​(char cIllegalChar)
      • onIllegalCharacter

        public void onIllegalCharacter​(char cIllegalChar)
        Description copied from interface: ICSSParseErrorHandler
        This method is invoked, when an illegal character is encountered (in TokenManager), and the respective rule is part of the JavaCC grammar.
        Specified by:
        onIllegalCharacter in interface ICSSParseErrorHandler
        Parameters:
        cIllegalChar - The illegal char