Interface ErrorHandler
- All Known Implementing Classes:
DefaultErrorHandler
,LogErrorHandler
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
computedStyleError
(CSSElement element, String propertyName, CSSPropertyValueException exception) Error found in computed style declaration.void
computedStyleWarning
(CSSElement element, String propertyName, CSSPropertyValueException exception) Error found in computed style declaration.Get the error handler for the given element's inline style.boolean
Check whether this handler has processed computed style errors.boolean
hasComputedStyleErrors
(CSSElement element) Check whether this handler has processed computed style errors for the given element.boolean
Check whether this handler has processed computed style warnings.boolean
hasComputedStyleWarnings
(CSSElement element) Check whether this handler has processed computed style warnings for the given element.boolean
Check whether this handler has processed any non-transient error.boolean
Check whether this handler has processed any I/O errors.boolean
Check whether this handler has processed any media-related errors.boolean
Check whether this handler has processed any media-related warnings.boolean
Check whether this handler has processed any policy errors.boolean
Check whether this handler has processed any warnings.void
inlineStyleError
(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).void
ioError
(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.void
linkedSheetError
(Exception exception, CSSStyleSheet<? extends CSSRule> sheet) Report an error associated to aLinkStyle
style sheet (i.e.void
linkedStyleError
(Node ownerNode, String message) Report an error related to linked style, where it was not possible to create the style sheet linked fromnode
due to an issue with the given node or other node in the document (as opposed to an issue with the linked style sheet itself).void
mediaQueryError
(Node ownerNode, CSSMediaException exception) Report a media query error.void
mediaQueryWarning
(Node ownerNode, CSSMediaException exception) Report a media query warning.void
policyError
(Node node, String message) Report a policy error, including possible security issues.void
presentationalHintError
(CSSElement element, DOMException exception) While computing a style, an error was found when processing the presentational hints of an element.void
reset()
Reset the error handler.void
Reset the error state about computed styles and presentational hints.void
resetComputedStyleErrors
(CSSElement element) Reset the error state about computed styles and presentational hints for the given element.default void
ruleIOError
(String uri, IOException exception) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
hasPolicyErrors
boolean hasPolicyErrors()Check whether this handler has processed any policy errors.- Returns:
true
if 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:
true
if 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:
true
if this handler processed computed style errors.
-
hasMediaErrors
boolean hasMediaErrors()Check whether this handler has processed any media-related errors.- Returns:
true
if this handler processed any media-related errors.
-
hasIOErrors
boolean hasIOErrors()Check whether this handler has processed any I/O errors.- Returns:
true
if 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:
true
if this handler processed any non-transient errors.
-
hasComputedStyleWarnings
boolean hasComputedStyleWarnings()Check whether this handler has processed computed style warnings.- Returns:
true
if 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:
true
if this handler processed computed style warnings.
-
hasMediaWarnings
boolean hasMediaWarnings()Check whether this handler has processed any media-related warnings.- Returns:
true
if this handler processed any media-related warnings.
-
hasWarnings
boolean hasWarnings()Check whether this handler has processed any warnings.- Returns:
true
if 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 fromnode
due 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 aLinkStyle
style sheet (i.e.LINK
orSTYLE
elements), that caused an exception to be thrown.- Parameters:
exception
- the exception describing the problem.sheet
- the linked or embedded style sheet.
-
ruleIOError
Deprecated, for removal: This API element is subject to removal in a future version.A I/O error was produced when retrieving a resource while processing a rule, generally an @import or @font-face rule.- Parameters:
uri
- the uri for the resource.exception
- the exception describing the problem.- See Also:
-
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.
-
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
null
if 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
CSSException
if 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;
-