Class CssFileImpl

  • All Implemented Interfaces:
    CssFile

    public class CssFileImpl
    extends java.lang.Object
    implements CssFile
    Implementation of CssFile, the CSS is stored in a map.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean persistent  
      private java.util.List<CssRule> rules  
    • Constructor Summary

      Constructors 
      Constructor Description
      CssFileImpl()
      Constructs a new CssFileImpl.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.String selector, java.util.Map<java.lang.String,​java.lang.String> props)
      Add CSS to this CssFile.
      java.util.List<CssRule> get​(Tag t)
      Return CSS declarations for the given tag.
      boolean isPersistent()  
      void isPersistent​(boolean isPeristent)
      Indicates that this file should be kept.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • rules

        private final java.util.List<CssRule> rules
      • persistent

        private boolean persistent
    • Constructor Detail

      • CssFileImpl

        public CssFileImpl()
        Constructs a new CssFileImpl.
    • Method Detail

      • add

        public boolean add​(java.lang.String selector,
                           java.util.Map<java.lang.String,​java.lang.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 java.util.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 isPeristent)
        Indicates that this file should be kept.
        Specified by:
        isPersistent in interface CssFile
        Parameters:
        isPeristent - set to true if this file should be kept.