- All Known Implementing Classes:
DefaultErrorHandler,LogErrorHandler
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidcomputedStyleError(CSSElement element, String propertyName, CSSPropertyValueException exception) Error found in computed style declaration.voidcomputedStyleWarning(CSSElement element, String propertyName, CSSPropertyValueException exception) Error found in computed style declaration.Get the error handler for the given element's inline style.booleanCheck whether this handler has processed computed style errors.booleanhasComputedStyleErrors(CSSElement element) Check whether this handler has processed computed style errors for the given element.booleanCheck whether this handler has processed computed style warnings.booleanhasComputedStyleWarnings(CSSElement element) Check whether this handler has processed computed style warnings for the given element.booleanCheck whether this handler has processed any non-transient error.booleanCheck whether this handler has processed inline style errors.booleanCheck whether this handler has processed any I/O errors.booleanCheck whether this handler has processed any media-related errors.booleanCheck whether this handler has processed any media-related warnings.booleanCheck whether this handler has processed any Node errors.booleanCheck whether this handler has processed any policy errors.booleanCheck whether this handler has processed any warnings.voidinlineStyleError(CSSElement owner, Exception exception, String inlineStyle) Report a problem with setting an inline style, that caused an exception to be thrown by lower-level parsing (NSAC).voidioError(String uri, IOException exception) A I/O error was found when retrieving a resource while processing an attribute (usuallyhref) or a rule, generally an @import or @font-face rule.voidlinkedSheetError(Exception exception, CSSStyleSheet<? extends CSSRule> sheet) Report an error associated to aLinkStylestyle sheet (i.e.voidlinkedStyleError(Node ownerNode, String message) Report an error related to linked style, where it was not possible to create the style sheet linked fromnodedue to an issue with the given node or other node in the document (as opposed to an issue with the linked style sheet itself).voidmediaQueryError(Node ownerNode, CSSMediaException exception) Report a media query error.voidmediaQueryWarning(Node ownerNode, CSSMediaException exception) Report a media query warning.default voidA generic error was found when processing a Node, one that is not directly associated to a style sheet or declaration.voidpolicyError(Node node, String message) Report a policy error, including possible security issues.voidpresentationalHintError(CSSElement element, DOMException exception) While computing a style, an error was found when processing the presentational hints of an element.voidreset()Reset the error handler.voidReset the error state about computed styles and presentational hints.voidresetComputedStyleErrors(CSSElement element) Reset the error state about computed styles and presentational hints for the given element.
-
Method Details
-
hasPolicyErrors
boolean hasPolicyErrors()Check whether this handler has processed any policy errors.- Returns:
trueif this handler processed any policy errors.
-
hasComputedStyleErrors
boolean hasComputedStyleErrors()Check whether this handler has processed computed style errors.Presentational hint errors are included in this category, as they are found during style computation.
- Returns:
trueif this handler processed computed style errors.
-
hasComputedStyleErrors
Check whether this handler has processed computed style errors for the given element.Presentational hint errors are included in this category, as they are found during style computation.
- Parameters:
element- the element.- Returns:
trueif this handler processed computed style errors.
-
hasInlineErrors
boolean hasInlineErrors()Check whether this handler has processed inline style errors.- Returns:
trueif this handler processed inline style errors.
-
hasMediaErrors
boolean hasMediaErrors()Check whether this handler has processed any media-related errors.- Returns:
trueif this handler processed any media-related errors.
-
hasNodeErrors
boolean hasNodeErrors()Check whether this handler has processed any Node errors.- Returns:
trueif this handler processed any Node errors.
-
hasIOErrors
boolean hasIOErrors()Check whether this handler has processed any I/O errors.- Returns:
trueif this handler processed any I/O errors.
-
hasErrors
boolean hasErrors()Check whether this handler has processed any non-transient error.I/O errors are not taken into account by this method.
- Returns:
trueif this handler processed any non-transient errors.
-
hasComputedStyleWarnings
boolean hasComputedStyleWarnings()Check whether this handler has processed computed style warnings.- Returns:
trueif this handler processed computed style warnings.
-
hasComputedStyleWarnings
Check whether this handler has processed computed style warnings for the given element.- Parameters:
element- the element.- Returns:
trueif this handler processed computed style warnings.
-
hasMediaWarnings
boolean hasMediaWarnings()Check whether this handler has processed any media-related warnings.- Returns:
trueif this handler processed any media-related warnings.
-
hasWarnings
boolean hasWarnings()Check whether this handler has processed any warnings.- Returns:
trueif this handler processed any warnings.
-
policyError
Report a policy error, including possible security issues.- Parameters:
node- the node that caused the policy violation, or where it was detected.message- a message describing the error.
-
linkedStyleError
Report an error related to linked style, where it was not possible to create the style sheet linked fromnodedue to an issue with the given node or other node in the document (as opposed to an issue with the linked style sheet itself).- Parameters:
ownerNode- the node where the error happened.message- a message describing the error.
-
mediaQueryError
Report a media query error.- Parameters:
ownerNode- the node that ultimately owns the sheet or rule where the media query appears (even if it is inside a nested sheet/rule, the node responsible is the one that owns the top-most style sheet).exception- the exception describing the error.
-
mediaQueryWarning
Report a media query warning.- Parameters:
ownerNode- the node that ultimately owns the sheet or rule where the media query appears (even if it is inside a nested sheet/rule, the node responsible is the one that owns the top-most style sheet).exception- the exception describing the issue.
-
linkedSheetError
Report an error associated to aLinkStylestyle sheet (i.e.LINKorSTYLEelements), that caused an exception to be thrown.- Parameters:
exception- the exception describing the problem.sheet- the linked or embedded style sheet.
-
ioError
A I/O error was found when retrieving a resource while processing an attribute (usuallyhref) or a rule, generally an @import or @font-face rule.- Parameters:
uri- the uri for the resource.exception- the exception describing the problem.
-
nodeError
A generic error was found when processing a Node, one that is not directly associated to a style sheet or declaration.It may be called while processing the URI of a document or a resource, generally the
hrefattribute.- Parameters:
node- the node.message- the error message. May benullif an exception is provided.t- the exception, ornullif there is a message.
-
getInlineStyleErrorHandler
Get the error handler for the given element's inline style.- Parameters:
owner- the element that owns the inline style.- Returns:
- the style's error handler. Implementations are allowed to return
nullif the element has no inline style.
-
inlineStyleError
Report a problem with setting an inline style, that caused an exception to be thrown by lower-level parsing (NSAC).This method is triggered only in two (unlikely) cases:
- If a problem appears when instantiating a NSAC parser.
- When the NSAC parser throws a
CSSException.
The NSAC parser does not throw a
CSSExceptionif there is an error handler set (and in this implementation there is always one), although other parsers may.- Parameters:
owner- the element owning the inline style.exception- the exception describing the problem.inlineStyle- the inline style.
-
computedStyleError
void computedStyleError(CSSElement element, String propertyName, CSSPropertyValueException exception) Error found in computed style declaration.This means that an error could only be found when processing the values for computing the style.
- Parameters:
element- the element for which the style was computed.propertyName- the name of the property involved in error.exception- the exception describing the error.
-
computedStyleWarning
void computedStyleWarning(CSSElement element, String propertyName, CSSPropertyValueException exception) Error found in computed style declaration.This means that an error could only be found when processing the values for computing the style.
- Parameters:
element- the element for which the style was computed.propertyName- the property name.exception- the exception describing the error.
-
presentationalHintError
While computing a style, an error was found when processing the presentational hints of an element.- Parameters:
element- the element.exception- the exception describing the error found.
-
resetComputedStyleErrors
Reset the error state about computed styles and presentational hints for the given element.- Parameters:
element- the element.
-
resetComputedStyleErrors
void resetComputedStyleErrors()Reset the error state about computed styles and presentational hints. -
reset
void reset()Reset the error handler.After calling this method,
hasErrors()andhasWarnings()must return false;
-