@ThreadSafe public class CollectingCSSParseErrorHandler extends Object implements ICSSParseErrorHandler
ICSSParseErrorHandler. So in case a
recoverable error occurs, it is remembered in the internal list and can be
retrieved by getAllParseErrors().| Constructor and Description |
|---|
CollectingCSSParseErrorHandler() |
CollectingCSSParseErrorHandler(ICSSParseErrorHandler aNestedErrorHandler) |
| Modifier and Type | Method and Description |
|---|---|
List<CSSParseError> |
getAllParseErrors() |
int |
getParseErrorCount() |
boolean |
hasParseErrors() |
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 CollectingCSSParseErrorHandler()
public CollectingCSSParseErrorHandler(@Nullable ICSSParseErrorHandler aNestedErrorHandler)
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.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.@Nonnegative public boolean hasParseErrors()
true if at least one parse error is contained,
false otherwise.@Nonnegative public int getParseErrorCount()
@Nonnull @ReturnsMutableCopy public List<CSSParseError> getAllParseErrors()
null but maybe empty.getParseErrorCount(),
hasParseErrors()Copyright © 2014–2016 Philip Helger. All rights reserved.