Class CSSFileWrapper

java.lang.Object
com.itextpdf.tool.xml.css.CSSFileWrapper
All Implemented Interfaces:
CssFile

public class CSSFileWrapper extends Object implements CssFile
This Wrapper disables the add and isPersistent(final boolean b) methods.
  • Field Details

    • persistent

      private final boolean persistent
    • css

      private final CssFile css
  • Constructor Details

    • CSSFileWrapper

      public CSSFileWrapper(CssFile css, boolean b)
      Constructs a CssFile that does not allow adding of new CSS (given you don't mess with the CssFile provided on construction).
      Parameters:
      css - the css file
      b - true if this file should be kept forever.
  • Method Details

    • add

      public boolean add(String selector, Map<String,String> props)
      Description copied from interface: CssFile
      Add CSS to this CssFile.
      Specified by:
      add in interface CssFile
      Parameters:
      selector - the CSS selector
      props - the properties for the given selector
    • get

      public List<CssRule> get(Tag t)
      Description copied from interface: CssFile
      Return CSS declarations for the given tag.
      Specified by:
      get in interface CssFile
      Parameters:
      t - the tag for searching rules
      Returns:
      a list of maps with all CSS properties for this tag or an empty list if none found.
    • isPersistent

      public boolean isPersistent()
      Specified by:
      isPersistent in interface CssFile
      Returns:
      if this CSS file should never be thrown away. Used in CSSFilesImpl#clear
    • isPersistent

      public void isPersistent(boolean b)
      Description copied from interface: CssFile
      Indicates that this file should be kept.
      Specified by:
      isPersistent in interface CssFile
      Parameters:
      b - true if this file should be kept.