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
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.voidsetProperty(String propertyName, LexicalUnit value, String priority) Set a CSS property, based on lexixal value.abstract voidwriteCssText(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 org.w3c.dom.css.CSSStyleDeclaration
getCssText, getLength, getPropertyPriority, item, removeProperty, setCssText, setPropertyMethods 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:
getMinifiedCssTextin 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:
writeCssTextin 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:ExtendedCSSStyleDeclarationGets 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- Specified by:
getPropertyCSSValuein 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
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 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.
-