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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringRetrieves a minified textual representation of the declaration block (excluding the surrounding curly braces).abstract StyleValuegetPropertyCSSValue(String propertyName) Gets the object representation of the value of a CSS property if it has been explicitly set for this declaration block.abstract StyleDeclarationErrorHandlerGet the error handler for this style declaration.protected abstract CSSStyleSheetFactoryabstract booleanisEmpty()Is this style declaration empty?protected abstract voidprioritySplit(AbstractCSSStyleDeclaration importantDecl, AbstractCSSStyleDeclaration normalDecl) Splits this style declaration in two: one for important properties only, and the other with normal properties.voidsetLexicalProperty(String propertyName, LexicalUnit value, boolean important) Set a CSS property as a raw lexical value.voidsetProperty(String propertyName, LexicalUnit value, boolean important) Set a CSS property, based on lexical value.abstract voidwriteCssText(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, waitMethods 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:
getMinifiedCssTextin 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:
writeCssTextin 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:CSSStyleDeclarationGets 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
IEVALUESflag 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:
getPropertyCSSValuein 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
nullif the property has not been set or is a shorthand.
-
getStyleDeclarationErrorHandler
Get the error handler for this style declaration.- Returns:
- the error handler, or
nullif this is an anonymous style declaration.
-
getStyleSheetFactory
-
isEmpty
public abstract boolean isEmpty()Is this style declaration empty?- Returns:
trueif the declaration is empty,falseotherwise.
-
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-trueif 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-trueif the priority is important.- Throws:
DOMException- if some error or inconsistency is found in the value.
-