Class AbstractCSSStyleDeclaration

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 Details

    • AbstractCSSStyleDeclaration

      public AbstractCSSStyleDeclaration()
  • Method Details

    • getMinifiedCssText

      public abstract String getMinifiedCssText()
      Retrieves a minified textual representation of the declaration block (excluding the surrounding curly braces).
      Specified by:
      getMinifiedCssText in interface ExtendedCSSStyleDeclaration
      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 a SimpleWriter, and according to a StyleFormattingContext.
      Specified by:
      writeCssText in interface ExtendedCSSStyleDeclaration
      Parameters:
      wri - the simple writer to write to.
      context - the style formatting context.
      Throws:
      IOException - if a problem occurs while writing the text.
    • getPropertyCSSValue

      public abstract StyleValue getPropertyCSSValue(String propertyName)
      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 interface CSSStyleDeclaration
      Specified by:
      getPropertyCSSValue in interface ExtendedCSSStyleDeclaration
      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

      public abstract StyleDeclarationErrorHandler getStyleDeclarationErrorHandler()
      Get the error handler for this style declaration.
      Returns:
      the error handler, or null if this is an anonymous style declaration.
    • getStyleSheetFactory

      protected abstract CSSStyleSheetFactory 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

      void setProperty(String propertyName, LexicalUnit value, String priority) throws DOMException
      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.