Package io.sf.carte.doc.style.css.om
Class DefaultSheetErrorHandler
java.lang.Object
io.sf.carte.doc.style.css.om.DefaultSheetErrorHandler
- All Implemented Interfaces:
SACErrorHandler,SheetErrorHandler,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbadAtRule(DOMException e, String atRule) A fatal problem was found parsing an at-rule.voidbadMediaList(MediaQueryList media) Found a media-related rule with a wrong media list.voidemptyStyleRule(String selector) Notify this handler that an empty style rule (a style rule without property value declarations) was found.voidfontFormatError(CSSFontFaceRule rule, Exception exception) Found a font format error when loading a font-face rule.getRuleAtError(int index) voidhandleSacError(CSSParseException exception) Handle a SAC error or fatal error.voidhandleSacWarning(CSSParseException exception) Handle a SAC warning.booleanCheck whether this object has handled higher-level object model errors.booleanCheck whether this object has handled higher-level object model warnings.booleanCheck whether this handler has been notified of SAC errors (or fatal errors).booleanCheck whether this handler has been notified of SAC warnings.voidignoredImport(String uri) Notify this handler that an import rule was ignored for the given uri.voidinlineStyleError(DOMException e, Element elm, String attr) Report an error processing an inline style.voidmapError(CSSParseException exception, CSSRule rule) Map a SAC error or fatal error to a specific rule.voidmergeState(SheetErrorHandler other) Merge the error state from the error handler of another sheet.voidreset()Reset the error handler, getting it ready for a new run.voidruleParseError(CSSRule rule, CSSParseException ex) An error was found when parsing a rule.voidruleParseWarning(CSSRule rule, CSSParseException ex) A warning was produced when parsing a rule.voidsacMalfunction(String message) the NSAC parser is malfunctioning.toString()voidunknownRule(String rule) Notify this handler that a rule of unknown type was found.
-
Constructor Details
-
DefaultSheetErrorHandler
-
-
Method Details
-
badAtRule
Description copied from interface:SheetErrorHandlerA fatal problem was found parsing an at-rule.- Specified by:
badAtRulein interfaceSheetErrorHandler- Parameters:
e- the exception explaining the problem.atRule- the text containing the at-rule.
-
badMediaList
Description copied from interface:SheetErrorHandlerFound a media-related rule with a wrong media list.- Specified by:
badMediaListin interfaceSheetErrorHandler- Parameters:
media- the media list.
-
emptyStyleRule
Description copied from interface:SheetErrorHandlerNotify this handler that an empty style rule (a style rule without property value declarations) was found.- Specified by:
emptyStyleRulein interfaceSheetErrorHandler- Parameters:
selector- the selector for the empty rule.
-
handleSacError
Description copied from interface:SACErrorHandlerHandle a SAC error or fatal error.- Specified by:
handleSacErrorin interfaceSACErrorHandler- Parameters:
exception- the parse exception.
-
handleSacWarning
Description copied from interface:SACErrorHandlerHandle a SAC warning.- Specified by:
handleSacWarningin interfaceSACErrorHandler- Parameters:
exception- the parse exception.
-
hasOMErrors
public boolean hasOMErrors()Description copied from interface:SheetErrorHandlerCheck whether this object has handled higher-level object model errors.- Specified by:
hasOMErrorsin interfaceSheetErrorHandler- Returns:
trueif this object has handled higher-level object model errors.
-
hasOMWarnings
public boolean hasOMWarnings()Description copied from interface:SheetErrorHandlerCheck whether this object has handled higher-level object model warnings.- Specified by:
hasOMWarningsin interfaceSheetErrorHandler- Returns:
trueif this object has handled higher-level object model warnings.
-
hasSacErrors
public boolean hasSacErrors()Description copied from interface:SACErrorHandlerCheck whether this handler has been notified of SAC errors (or fatal errors).- Specified by:
hasSacErrorsin interfaceSACErrorHandler- Returns:
trueif SAC errors or fatal errors were notified since lastSheetErrorHandler.reset(),falseotherwise.
-
hasSacWarnings
public boolean hasSacWarnings()Description copied from interface:SACErrorHandlerCheck whether this handler has been notified of SAC warnings.- Specified by:
hasSacWarningsin interfaceSACErrorHandler- Returns:
trueif SAC warnings were notified since lastSheetErrorHandler.reset(),falseotherwise.
-
ignoredImport
Description copied from interface:SheetErrorHandlerNotify 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:
ignoredImportin interfaceSheetErrorHandler- Parameters:
uri- the uri for the ignored rule.
-
inlineStyleError
Description copied from interface:SheetErrorHandlerReport an error processing an inline style.In HTML, it means that the style declration within the
styleattribute could not be parsed.- Specified by:
inlineStyleErrorin interfaceSheetErrorHandler- Parameters:
e- the exception found.elm- the element whose inline style was parsed.attr- the contents of the attribute containing the inline style (generallystyle).
-
ruleParseError
Description copied from interface:SheetErrorHandlerAn error was found when parsing a rule.- Specified by:
ruleParseErrorin interfaceSheetErrorHandler- Parameters:
rule- the rule.ex- the exception.
-
ruleParseWarning
Description copied from interface:SheetErrorHandlerA warning was produced when parsing a rule.- Specified by:
ruleParseWarningin interfaceSheetErrorHandler- Parameters:
rule- the rule.ex- the exception.
-
fontFormatError
Description copied from interface:SheetErrorHandlerFound a font format error when loading a font-face rule.- Specified by:
fontFormatErrorin interfaceSheetErrorHandler- Parameters:
rule- the font-face rule.exception- the exception describing the error.
-
unknownRule
Description copied from interface:SheetErrorHandlerNotify this handler that a rule of unknown type was found.- Specified by:
unknownRulein interfaceSheetErrorHandler- Parameters:
rule- the unknown rule.
-
mapError
Description copied from interface:SACErrorHandlerMap a SAC error or fatal error to a specific rule.- Specified by:
mapErrorin interfaceSACErrorHandler- Parameters:
exception- the parse exception.rule- the rule having the error.
-
getBadAtRules
-
getBadInlineStyles
-
getBadMediaLists
-
getEmptyStyleRules
-
getIgnoredImports
-
getRuleAtError
-
getRuleParseErrors
-
getSacErrors
-
getSacWarnings
-
getUnknownRules
-
mergeState
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:
mergeStatein interfaceSheetErrorHandler- Parameters:
other- the other style sheet error handler.
-
reset
public void reset()Description copied from interface:SheetErrorHandlerReset the error handler, getting it ready for a new run.- Specified by:
resetin interfaceSheetErrorHandler
-
toString
-
sacMalfunction
Description copied from interface:SheetErrorHandlerthe 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:
sacMalfunctionin interfaceSheetErrorHandler- Parameters:
message- the message.
-