Class CssRuleSet

    • Field Detail

      • IMPORTANT_MATCHER

        private static final java.util.regex.Pattern IMPORTANT_MATCHER
        Pattern to match "important" in a rule declaration.
      • normalDeclarations

        private java.util.List<CssDeclaration> normalDeclarations
        The normal CSS declarations.
      • importantDeclarations

        private java.util.List<CssDeclaration> importantDeclarations
        The important CSS declarations.
    • Constructor Detail

      • CssRuleSet

        public CssRuleSet​(ICssSelector selector,
                          java.util.List<CssDeclaration> declarations)
        Creates a new CssRuleSet from selector and raw list of declarations. The declarations are split into normal and important under the hood. To construct the CssRuleSet instance from normal and important declarations, see CssRuleSet(ICssSelector, List, List)
        Parameters:
        selector - the CSS selector
        declarations - the CSS declarations
      • CssRuleSet

        public CssRuleSet​(ICssSelector selector,
                          java.util.List<CssDeclaration> normalDeclarations,
                          java.util.List<CssDeclaration> importantDeclarations)
        Creates a new CssRuleSet from a selector and a list of normal and important declarations.
        Parameters:
        selector - the CSS selector
        normalDeclarations - the list of normal declarations
        importantDeclarations - the list of important declarations
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getSelector

        public ICssSelector getSelector()
        Gets the CSS selector.
        Returns:
        the CSS selector
      • getNormalDeclarations

        public java.util.List<CssDeclaration> getNormalDeclarations()
        Gets the normal CSS declarations.
        Returns:
        the normal declarations
      • getImportantDeclarations

        public java.util.List<CssDeclaration> getImportantDeclarations()
        Gets the important CSS declarations.
        Returns:
        the important declarations
      • splitDeclarationsIntoNormalAndImportant

        private static void splitDeclarationsIntoNormalAndImportant​(java.util.List<CssDeclaration> declarations,
                                                                    java.util.List<CssDeclaration> normalDeclarations,
                                                                    java.util.List<CssDeclaration> importantDeclarations)
        Split CSS declarations into normal and important CSS declarations.
        Parameters:
        declarations - the declarations