Class AbstractCSSRule

All Implemented Interfaces:
CSSRule, Serializable, CSSRule
Direct Known Subclasses:
BaseCSSDeclarationRule, FontFeatureValuesRule, GroupingRule, ImportRule, KeyframesRule, NamespaceRule, UnknownRule

public abstract class AbstractCSSRule extends Object implements CSSRule, Serializable
Abstract class to be inherited by all CSS rules.
See Also:
  • Constructor Details

    • AbstractCSSRule

      public AbstractCSSRule()
  • Method Details

    • getType

      public abstract short getType()
      Specified by:
      getType in interface CSSRule
    • getCssText

      public abstract String getCssText()
      Specified by:
      getCssText in interface CSSRule
    • getMinifiedCssText

      public abstract String getMinifiedCssText()
      A minified parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.
      Specified by:
      getMinifiedCssText in interface CSSRule
      the minified textual representation of the rule.
    • toString

      public String toString()
      toString in class Object
    • writeCssText

      public abstract void writeCssText(SimpleWriter wri, StyleFormattingContext context) throws IOException
      Description copied from interface: CSSRule
      Write a serialization of this rule to the given simple writer, according to the given context.
      Specified by:
      writeCssText in interface CSSRule
      wri - the simple writer object.
      context - the formatting context.
      IOException - if an error happened while writing.
    • getParentStyleSheet

      public abstract AbstractCSSStyleSheet getParentStyleSheet()
      Description copied from interface: CSSRule
      Get the style sheet that contains this rule.
      Specified by:
      getParentStyleSheet in interface CSSRule
      Specified by:
      getParentStyleSheet in interface CSSRule
      the style sheet, or null if no sheet contains this rule.
    • getParentRule

      public abstract AbstractCSSRule getParentRule()
      Description copied from interface: CSSRule
      If this rule is contained inside another rule, return that rule. If it is not nested inside any other rules, return null.
      Specified by:
      getParentRule in interface CSSRule
      Specified by:
      getParentRule in interface CSSRule
      the containing rule, if any, otherwise null.
    • setParentRule

      public abstract void setParentRule(AbstractCSSRule parent)
    • getOrigin

      public abstract byte getOrigin()
      Get the origin of this rule (user agent sheet, author, user).
      the origin of this rule.
    • enablePrecedingComments

      public abstract void enablePrecedingComments()
      If this rule does not contain a preceding comment list, create one.

      If this rule already has a preceding comment list, does nothing.

    • enableTrailingComments

      public abstract void enableTrailingComments()
      If this rule does not contain a trailing comment list, create one.

      If this rule already has a trailing comment list, does nothing.

    • clone

      public abstract AbstractCSSRule clone(AbstractCSSStyleSheet parentSheet)
      Obtain a clone of this rule whose parent sheet is parentSheet.
      parentSheet - the parent sheet for the new rule.
      a clone of this rule with the given parent sheet.