@Immutable public class LoggingCSSParseErrorHandler extends Object implements ICSSParseErrorHandler
ICSSParseErrorHandler. So in case a
recoverable error occurs, the details are logged to an SLF4J logger.| Constructor and Description |
|---|
LoggingCSSParseErrorHandler()
Default constructor.
|
LoggingCSSParseErrorHandler(ICSSParseErrorHandler aNestedErrorHandler)
Constructor with a nested error handler.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
createLoggingStringParseError(ParseException ex) |
static String |
createLoggingStringParseError(Token aLastValidToken,
int[][] aExpectedTokenSequencesVal,
String[] aTokenImageVal,
Token aLastSkippedToken) |
static String |
createLoggingStringUnexpectedRule(Token aCurrentToken,
String sRule,
String sMsg)
Create a common string to be used for unexpected rules.
|
void |
onCSSParseError(Token aLastValidToken,
int[][] aExpectedTokenSequencesVal,
String[] aTokenImageVal,
Token aLastSkippedToken)
Called upon a recoverable error.
|
void |
onCSSUnexpectedRule(Token aCurrentToken,
String sRule,
String sMsg)
Called upon an unexpected rule.
|
String |
toString() |
public LoggingCSSParseErrorHandler()
public LoggingCSSParseErrorHandler(@Nullable ICSSParseErrorHandler aNestedErrorHandler)
aNestedErrorHandler - The nested error handler to be invoked after this error handler. May
be null to indicate that no nested error handler is
present.@Nonnull @Nonempty public static String createLoggingStringParseError(@Nonnull ParseException ex)
@Nonnull @Nonempty public static String createLoggingStringParseError(@Nonnull Token aLastValidToken, @Nonnull int[][] aExpectedTokenSequencesVal, @Nonnull String[] aTokenImageVal, @Nullable Token aLastSkippedToken)
public void onCSSParseError(@Nonnull Token aLastValidToken, @Nonnull int[][] aExpectedTokenSequencesVal, @Nonnull String[] aTokenImageVal, @Nullable Token aLastSkippedToken) throws ParseException
ICSSParseErrorHandlerParseException.onCSSParseError in interface ICSSParseErrorHandleraLastValidToken - The last valid token. May not be null.aExpectedTokenSequencesVal - The expected token. May not be null.aTokenImageVal - The error token image. May not be null.aLastSkippedToken - The token until which was skipped (incl.) May be null.ParseException - In case the error is fatal and should be propagated.@Nonnull @Nonempty public static String createLoggingStringUnexpectedRule(@Nonnull Token aCurrentToken, @Nonnull @Nonempty String sRule, @Nonnull @Nonempty String sMsg)
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.null nor empty.public void onCSSUnexpectedRule(@Nonnull Token aCurrentToken, @Nonnull @Nonempty String sRule, @Nonnull @Nonempty String sMsg) throws ParseException
ICSSParseErrorHandler@import
is used in the middle of the file.onCSSUnexpectedRule in interface ICSSParseErrorHandleraCurrentToken - 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.ParseException - In case the error is fatal and should be propagated.Copyright © 2014–2016 Philip Helger. All rights reserved.