Class CssStyleSheet

java.lang.Object
com.itextpdf.styledxmlparser.css.CssStyleSheet

public class CssStyleSheet extends Object
Class that stores all the CSS statements, and thus acts as a CSS style sheet.
  • Constructor Details

    • CssStyleSheet

      public CssStyleSheet()
      Creates a new CssStyleSheet instance.
  • Method Details

    • addStatement

      public void addStatement (CssStatement statement)
      Adds a CSS statement to the style sheet.
      Parameters:
      statement - the CSS statement
    • appendCssStyleSheet

      public void appendCssStyleSheet (CssStyleSheet anotherCssStyleSheet)
      Append another CSS style sheet to this one.
      Parameters:
      anotherCssStyleSheet - the other CSS style sheet
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getStatements

      public List<CssStatement> getStatements()
      Gets the CSS statements of this style sheet.
      Returns:
      the CSS statements
    • getCssDeclarations

      public List<CssDeclaration> getCssDeclarations (INode node, MediaDeviceDescription deviceDescription)
      Gets the CSS declarations.
      Parameters:
      node - the node
      deviceDescription - the media device description
      Returns:
      the CSS declarations
    • extractStylesFromRuleSets

      public static Map<String,String> extractStylesFromRuleSets (List<CssRuleSet> ruleSets)
      Gets the CSS declarations.
      Parameters:
      ruleSets - list of css rule sets
      Returns:
      the CSS declarations
    • getCssRuleSets

      public List<CssRuleSet> getCssRuleSets (INode node, MediaDeviceDescription deviceDescription)
      Gets the CSS rule sets.
      Parameters:
      node - the node
      deviceDescription - the device description
      Returns:
      the css rule sets