Class CssSelector

java.lang.Object
com.itextpdf.styledxmlparser.css.selector.AbstractCssSelector
com.itextpdf.styledxmlparser.css.selector.CssSelector
All Implemented Interfaces:
ICssSelector

public class CssSelector extends AbstractCssSelector
ICssSelector implementation for CSS selectors.
  • Constructor Details

    • CssSelector

      public CssSelector(List<ICssSelectorItem> selectorItems)
      Creates a new CssSelector instance.
      Parameters:
      selectorItems - the selector items
    • CssSelector

      public CssSelector(String selector)
      Creates a new CssSelector instance.
      Parameters:
      selector - the selector
  • Method Details

    • matches

      public boolean matches(INode element)
      Description copied from interface: ICssSelector
      Checks if a node matches the selector.
      Parameters:
      element - the node
      Returns:
      true, if the selector is a match for the node
    • matches

      private boolean matches(INode element, int lastSelectorItemInd)
      Checks if a node matches the selector.
      Parameters:
      element - the node
      lastSelectorItemInd - the index of the last selector
      Returns:
      true, if there's a match