Package io.sf.carte.doc.style.css.om
Class AbstractCSSStyleDeclaration
java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSStyleDeclaration
- All Implemented Interfaces:
CSSStyleDeclaration
,Serializable
- Direct Known Subclasses:
BaseCSSStyleDeclaration
public abstract class AbstractCSSStyleDeclaration
extends Object
implements CSSStyleDeclaration, Serializable
Abstract class to be inherited by all CSS style declarations.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
Retrieves a minified textual representation of the declaration block (excluding the surrounding curly braces).abstract StyleValue
getPropertyCSSValue
(String propertyName) Gets the object representation of the value of a CSS property if it has been explicitly set for this declaration block.abstract StyleDeclarationErrorHandler
Get the error handler for this style declaration.protected abstract CSSStyleSheetFactory
abstract boolean
isEmpty()
Is this style declaration empty?protected abstract void
prioritySplit
(AbstractCSSStyleDeclaration importantDecl, AbstractCSSStyleDeclaration normalDecl) Splits this style declaration in two: one for important properties only, and the other with normal properties.void
setLexicalProperty
(String propertyName, LexicalUnit value, boolean important) Set a CSS property as a raw lexical value.void
setProperty
(String propertyName, LexicalUnit value, boolean important) Set a CSS property, based on lexical value.abstract void
writeCssText
(io.sf.carte.util.SimpleWriter wri, StyleFormattingContext context) Writes a textual representation of the declaration block (excluding the surrounding curly braces) to aSimpleWriter
, and according to aStyleFormattingContext
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.CSSStyleDeclaration
getCssText, getLength, getParentRule, getPropertyPriority, getPropertyValue, item, removeProperty, setCssText, setProperty
-
Constructor Details
-
AbstractCSSStyleDeclaration
public AbstractCSSStyleDeclaration()
-
-
Method Details
-
getMinifiedCssText
Retrieves a minified textual representation of the declaration block (excluding the surrounding curly braces).- Specified by:
getMinifiedCssText
in interfaceCSSStyleDeclaration
- Returns:
- the minified representation of this style declaration.
-
writeCssText
public abstract void writeCssText(io.sf.carte.util.SimpleWriter wri, StyleFormattingContext context) throws IOException Writes a textual representation of the declaration block (excluding the surrounding curly braces) to aSimpleWriter
, and according to aStyleFormattingContext
.- Specified by:
writeCssText
in interfaceCSSStyleDeclaration
- Parameters:
wri
- the simple writer to write to.context
- the style formatting context.- Throws:
IOException
- if a problem occurs while writing the text.
-
getPropertyCSSValue
Description copied from interface:CSSStyleDeclaration
Gets the object representation of the value of a CSS property if it has been explicitly set for this declaration block.If the declaration was created by a factory with the
IEVALUES
flag enabled, the compatibility values shall appear in the cssText serializations, but its value won't be returned by this method unless no other valid value was previously specified for the property.- Specified by:
getPropertyCSSValue
in interfaceCSSStyleDeclaration
- Parameters:
propertyName
- The name of the CSS property.- Returns:
- the value of the property if it has been explicitly set for this declaration
block. Returns
null
if the property has not been set or is a shorthand.
-
getStyleDeclarationErrorHandler
Get the error handler for this style declaration.- Returns:
- the error handler, or
null
if this is an anonymous style declaration.
-
getStyleSheetFactory
-
isEmpty
public abstract boolean isEmpty()Is this style declaration empty?- Returns:
true
if the declaration is empty,false
otherwise.
-
prioritySplit
protected abstract void prioritySplit(AbstractCSSStyleDeclaration importantDecl, AbstractCSSStyleDeclaration normalDecl) Splits this style declaration in two: one for important properties only, and the other with normal properties.- Parameters:
importantDecl
- the style declaration for important properties.normalDecl
- the style declaration for normal properties.
-
setProperty
Set a CSS property, based on lexical value.- Parameters:
propertyName
- the name of the property.value
- the lexical value.important
-true
if the priority is important.- Throws:
DOMException
- if some error or inconsistency is found in the value.
-
setLexicalProperty
void setLexicalProperty(String propertyName, LexicalUnit value, boolean important) throws DOMException Set a CSS property as a raw lexical value.- Parameters:
propertyName
- the name of the property.value
- the lexical value.important
-true
if the priority is important.- Throws:
DOMException
- if some error or inconsistency is found in the value.
-