Class ExceptionErrorHandler

java.lang.Object
io.sf.carte.doc.style.css.util.ExceptionErrorHandler
All Implemented Interfaces:
SACErrorHandler, SheetErrorHandler

public class ExceptionErrorHandler extends Object implements SheetErrorHandler
Error handler that just throws exceptions.

Useful for debugging.

  • Constructor Details

    • ExceptionErrorHandler

      public ExceptionErrorHandler()
  • Method Details

    • mapError

      public void mapError(CSSParseException exception, CSSRule rule)
      Description copied from interface: SACErrorHandler
      Map a SAC error or fatal error to a specific rule.
      Specified by:
      mapError in interface SACErrorHandler
      Parameters:
      exception - the parse exception.
      rule - the rule having the error.
    • handleSacWarning

      public void handleSacWarning(CSSParseException exception)
      Description copied from interface: SACErrorHandler
      Handle a SAC warning.
      Specified by:
      handleSacWarning in interface SACErrorHandler
      Parameters:
      exception - the parse exception.
    • handleSacError

      public void handleSacError(CSSParseException exception)
      Description copied from interface: SACErrorHandler
      Handle a SAC error or fatal error.
      Specified by:
      handleSacError in interface SACErrorHandler
      Parameters:
      exception - the parse exception.
    • hasSacErrors

      public boolean hasSacErrors()
      Description copied from interface: SACErrorHandler
      Check whether this handler has been notified of SAC errors (or fatal errors).
      Specified by:
      hasSacErrors in interface SACErrorHandler
      Returns:
      true if SAC errors or fatal errors were notified since last SheetErrorHandler.reset(), false otherwise.
    • hasSacWarnings

      public boolean hasSacWarnings()
      Description copied from interface: SACErrorHandler
      Check whether this handler has been notified of SAC warnings.
      Specified by:
      hasSacWarnings in interface SACErrorHandler
      Returns:
      true if SAC warnings were notified since last SheetErrorHandler.reset(), false otherwise.
    • badAtRule

      public void badAtRule(DOMException e, String atRule)
      Description copied from interface: SheetErrorHandler
      A fatal problem was found parsing an at-rule.
      Specified by:
      badAtRule in interface SheetErrorHandler
      Parameters:
      e - the exception explaining the problem.
      atRule - the text containing the at-rule.
    • badMediaList

      public void badMediaList(MediaQueryList media)
      Description copied from interface: SheetErrorHandler
      Found a media-related rule with a wrong media list.
      Specified by:
      badMediaList in interface SheetErrorHandler
      Parameters:
      media - the media list.
    • ignoredImport

      public void ignoredImport(String uri)
      Description copied from interface: SheetErrorHandler
      Notify this handler that an import rule was ignored for the given uri.

      Imports can be ignored if they happen at the wrong place.

      Specified by:
      ignoredImport in interface SheetErrorHandler
      Parameters:
      uri - the uri for the ignored rule.
    • conditionalRuleError

      public void conditionalRuleError(BooleanCondition condition, String message)
      Description copied from interface: SheetErrorHandler
      Report an error with the condition, in a conditional rule.
      Specified by:
      conditionalRuleError in interface SheetErrorHandler
      Parameters:
      condition - the condition.
      message - a message describing the issue.
    • ruleParseError

      public void ruleParseError(CSSRule rule, CSSParseException ex)
      Description copied from interface: SheetErrorHandler
      An error was found when parsing a rule.
      Specified by:
      ruleParseError in interface SheetErrorHandler
      Parameters:
      rule - the rule.
      ex - the exception.
    • ruleParseWarning

      public void ruleParseWarning(CSSRule rule, CSSParseException ex)
      Description copied from interface: SheetErrorHandler
      A warning was produced when parsing a rule.
      Specified by:
      ruleParseWarning in interface SheetErrorHandler
      Parameters:
      rule - the rule.
      ex - the exception.
    • fontFormatError

      public void fontFormatError(CSSFontFaceRule rule, Exception exception)
      Description copied from interface: SheetErrorHandler
      Found a font format error when loading a font-face rule.
      Specified by:
      fontFormatError in interface SheetErrorHandler
      Parameters:
      rule - the font-face rule.
      exception - the exception describing the error.
    • unknownRule

      public void unknownRule(String rule)
      Description copied from interface: SheetErrorHandler
      Notify this handler that a rule of unknown type was found.
      Specified by:
      unknownRule in interface SheetErrorHandler
      Parameters:
      rule - the unknown rule.
    • sacMalfunction

      public void sacMalfunction(String message)
      Description copied from interface: SheetErrorHandler
      the NSAC parser is malfunctioning. Implementations may just ignore this method.

      It may be called if a property was received for being processed outside of a rule.

      Specified by:
      sacMalfunction in interface SheetErrorHandler
      Parameters:
      message - the message.
    • hasOMErrors

      public boolean hasOMErrors()
      Description copied from interface: SheetErrorHandler
      Check whether this object has handled higher-level object model errors.
      Specified by:
      hasOMErrors in interface SheetErrorHandler
      Returns:
      true if this object has handled higher-level object model errors.
    • hasOMWarnings

      public boolean hasOMWarnings()
      Description copied from interface: SheetErrorHandler
      Check whether this object has handled higher-level object model warnings.
      Specified by:
      hasOMWarnings in interface SheetErrorHandler
      Returns:
      true if this object has handled higher-level object model warnings.
    • mergeState

      public void mergeState(SheetErrorHandler other)
      Description copied from interface: SheetErrorHandler
      Merge the error state from the error handler of another sheet.

      Implementations are only required to merge boolean state of NSAC errors and warnings. Merging other state is optional.

      Specified by:
      mergeState in interface SheetErrorHandler
      Parameters:
      other - the other style sheet error handler.
    • reset

      public void reset()
      Description copied from interface: SheetErrorHandler
      Reset the error handler, getting it ready for a new run.
      Specified by:
      reset in interface SheetErrorHandler