java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSStyleDeclaration
- All Implemented Interfaces:
ExtendedCSSStyleDeclaration
,CSSStyleDeclaration
- Direct Known Subclasses:
BaseCSSStyleDeclaration
public abstract class AbstractCSSStyleDeclaration
extends Object
implements ExtendedCSSStyleDeclaration
Abstract class to be inherited by all CSS style declarations.
-
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
setProperty
(String propertyName, LexicalUnit value, String priority) Set a CSS property, based on lexixal value.abstract void
writeCssText
(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 org.w3c.dom.css.CSSStyleDeclaration
getCssText, getLength, getPropertyPriority, item, removeProperty, setCssText, setProperty
Methods inherited from interface io.sf.carte.doc.style.css.ExtendedCSSStyleDeclaration
getParentRule, getPropertyValue
-
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 interfaceExtendedCSSStyleDeclaration
- Returns:
- the minified representation of this style declaration.
-
writeCssText
public abstract void writeCssText(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 interfaceExtendedCSSStyleDeclaration
- 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:ExtendedCSSStyleDeclaration
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
- Specified by:
getPropertyCSSValue
in interfaceExtendedCSSStyleDeclaration
- 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 lexixal value.- Parameters:
propertyName
- the name of the property.value
- the lexical value.priority
- the priority string.- Throws:
DOMException
- if some error or inconsistency is found in the value.
-