Module io.sf.carte.css4j
Package io.sf.carte.doc.style.css.om
Class DefaultStyleDeclarationErrorHandler
java.lang.Object
io.sf.carte.doc.style.css.om.DefaultStyleDeclarationErrorHandler
- All Implemented Interfaces:
StyleDeclarationErrorHandler
public class DefaultStyleDeclarationErrorHandler
extends Object
implements StyleDeclarationErrorHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
compatWarning
(String propertyName, String cssText) A warning due to the processing of IE-compatible values was issued.void
boolean
Has any error been reported?boolean
Have value warnings been reported to this error handler?void
malformedURIValue
(String uri) An URI CSS value contained a malformed URI.void
missingRequiredProperty
(String propertyName) A required property was missing when processing a shorthand.void
noContainingBlock
(String containedNode, Node ownerNode) Unable to find containing block forcontainedNode
.void
reset()
Reset this handler and prepare it to handle a new declaration.void
sacError
(CSSParseException exception, int previousIndex) Reports a SAC error as per the SAC ErrorHandler.void
sacFatalError
(CSSParseException exception, int previousIndex) Reports a SAC fatal error as per the SAC ErrorHandler.void
sacWarning
(CSSParseException exception, int previousIndex) Reports a SAC warning as per the SAC ErrorHandler.void
shorthandError
(String shorthandName, String message) Generic error while processing a shorthand.void
shorthandSyntaxError
(String shorthandName, String message) When processing a shorthand, a syntax error was found.void
shorthandWarning
(String shorthandName, String valueText) A shorthand could be processed, but was found to be browser-unsafe.void
syntaxWarning
(String message) A syntax issue was found, but not serious enough to trigger an error.toString()
void
unassignedShorthandValue
(String shorthandName, String valueCss) When processing a shorthand, an individual value could not be properly assigned to any subproperty.void
unassignedShorthandValues
(String shorthandName, String[] unassignedProperties, LexicalUnit[] unassignedValues) When processing a shorthand, some values could not be assigned.void
unknownIdentifier
(String propertyName, String ident) An unrecognized CSS identifier value was found for propertypropertyName
.void
void
wrongSubpropertyCount
(String shorthandName, int count) The number of subproperty values found in a shorthand is wrong.void
wrongValue
(String propertyName, CSSPropertyValueException e) The propertypropertyName
has a wrong value.
-
Constructor Details
-
DefaultStyleDeclarationErrorHandler
public DefaultStyleDeclarationErrorHandler()
-
-
Method Details
-
malformedURIValue
Description copied from interface:StyleDeclarationErrorHandler
An URI CSS value contained a malformed URI.- Specified by:
malformedURIValue
in interfaceStyleDeclarationErrorHandler
- Parameters:
uri
- the malformed uri.
-
shorthandError
Description copied from interface:StyleDeclarationErrorHandler
Generic error while processing a shorthand.- Specified by:
shorthandError
in interfaceStyleDeclarationErrorHandler
- Parameters:
shorthandName
- the shorthand name.message
- error message.
-
shorthandSyntaxError
Description copied from interface:StyleDeclarationErrorHandler
When processing a shorthand, a syntax error was found.- Specified by:
shorthandSyntaxError
in interfaceStyleDeclarationErrorHandler
- Parameters:
shorthandName
- the name of the shorthand property being processed.message
- a message describing the error.
-
shorthandWarning
Description copied from interface:StyleDeclarationErrorHandler
A shorthand could be processed, but was found to be browser-unsafe.- Specified by:
shorthandWarning
in interfaceStyleDeclarationErrorHandler
- Parameters:
shorthandName
- the name of the shorthand property.valueText
- the unsafe value text.
-
unassignedShorthandValues
public void unassignedShorthandValues(String shorthandName, String[] unassignedProperties, LexicalUnit[] unassignedValues) Description copied from interface:StyleDeclarationErrorHandler
When processing a shorthand, some values could not be assigned.- Specified by:
unassignedShorthandValues
in interfaceStyleDeclarationErrorHandler
- Parameters:
shorthandName
- the name of the shorthand property being processed.unassignedProperties
- a string array with the names of the subproperties that went without an assigned value and were reset to default values.unassignedValues
- the array of unassigned lexical unit values.
-
wrongSubpropertyCount
Description copied from interface:StyleDeclarationErrorHandler
The number of subproperty values found in a shorthand is wrong.- Specified by:
wrongSubpropertyCount
in interfaceStyleDeclarationErrorHandler
- Parameters:
shorthandName
- the name of the shorthand property being processed.count
- the number of values found.
-
unknownIdentifier
Description copied from interface:StyleDeclarationErrorHandler
An unrecognized CSS identifier value was found for propertypropertyName
.- Specified by:
unknownIdentifier
in interfaceStyleDeclarationErrorHandler
- Parameters:
propertyName
- the property name.ident
- the unrecognized identifier.
-
missingRequiredProperty
Description copied from interface:StyleDeclarationErrorHandler
A required property was missing when processing a shorthand.- Specified by:
missingRequiredProperty
in interfaceStyleDeclarationErrorHandler
- Parameters:
propertyName
- the missing property name.
-
wrongValue
Description copied from interface:StyleDeclarationErrorHandler
The propertypropertyName
has a wrong value.- Specified by:
wrongValue
in interfaceStyleDeclarationErrorHandler
- Parameters:
propertyName
- the property name.e
- the exception describing the problem.
-
syntaxWarning
Description copied from interface:StyleDeclarationErrorHandler
A syntax issue was found, but not serious enough to trigger an error.- Specified by:
syntaxWarning
in interfaceStyleDeclarationErrorHandler
- Parameters:
message
- a message describing the problem.
-
compatWarning
Description copied from interface:StyleDeclarationErrorHandler
A warning due to the processing of IE-compatible values was issued.- Specified by:
compatWarning
in interfaceStyleDeclarationErrorHandler
- Parameters:
propertyName
- the property name.cssText
- the faulty cssText.
-
noContainingBlock
Unable to find containing block forcontainedNode
.- Specified by:
noContainingBlock
in interfaceStyleDeclarationErrorHandler
- Parameters:
containedNode
- the contained node.ownerNode
- the owner node.
-
unassignedShorthandValue
Description copied from interface:StyleDeclarationErrorHandler
When processing a shorthand, an individual value could not be properly assigned to any subproperty.- Specified by:
unassignedShorthandValue
in interfaceStyleDeclarationErrorHandler
- Parameters:
shorthandName
- the name of the shorthand property being processed.valueCss
- the css text of the unassigned value.
-
hasErrors
public boolean hasErrors()Has any error been reported?- Specified by:
hasErrors
in interfaceStyleDeclarationErrorHandler
- Returns:
true
if some error was reported,false
otherwise. Unassigned subproperties aren't considered an error.
-
hasWarnings
public boolean hasWarnings()Description copied from interface:StyleDeclarationErrorHandler
Have value warnings been reported to this error handler?- Specified by:
hasWarnings
in interfaceStyleDeclarationErrorHandler
- Returns:
true
if value warnings were reported,false
otherwise.
-
getMalformedURIs
-
getShorthandsWithErrors
-
getUnassignedSubproperties
-
getWrongSubpropertyCount
-
getMissingRequiredValues
-
getUnknownIdentifiers
-
getWrongValues
-
getNoContainingBlock
-
getUnassignedValues
-
getSyntaxWarnings
-
reset
public void reset()Description copied from interface:StyleDeclarationErrorHandler
Reset this handler and prepare it to handle a new declaration.- Specified by:
reset
in interfaceStyleDeclarationErrorHandler
-
sacWarning
Description copied from interface:StyleDeclarationErrorHandler
Reports a SAC warning as per the SAC ErrorHandler.- Specified by:
sacWarning
in interfaceStyleDeclarationErrorHandler
- Parameters:
exception
- the parse exception.previousIndex
- the index for the previously set property in the properties collection, or -1 if the problem occurred with the first property or before that.
-
sacError
Description copied from interface:StyleDeclarationErrorHandler
Reports a SAC error as per the SAC ErrorHandler.- Specified by:
sacError
in interfaceStyleDeclarationErrorHandler
- Parameters:
exception
- the parse exception.previousIndex
- the index for the previously set property in the properties collection, or -1 if the problem occurred with the first property or before that.
-
sacFatalError
Description copied from interface:StyleDeclarationErrorHandler
Reports a SAC fatal error as per the SAC ErrorHandler.- Specified by:
sacFatalError
in interfaceStyleDeclarationErrorHandler
- Parameters:
exception
- the parse exception.previousIndex
- the index for the previously set property in the properties collection, or -1 if the problem occurred with the first property or before that.
-
getSACWarnings
-
getSACErrors
-
getSACFatalErrors
-
errorSummary
-
warningSummary
-
toString
-