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.
-
-
Field Summary
-
Fields inherited from class com.itextpdf.styledxmlparser.css.selector.AbstractCssSelector
selectorItems
-
-
Constructor Summary
Constructors Constructor Description CssSelector(java.lang.String selector)
Creates a newCssSelector
instance.CssSelector(java.util.List<ICssSelectorItem> selectorItems)
Creates a newCssSelector
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(INode element)
Checks if a node matches the selector.private boolean
matches(INode element, int lastSelectorItemInd)
Checks if a node matches the selector.-
Methods inherited from class com.itextpdf.styledxmlparser.css.selector.AbstractCssSelector
calculateSpecificity, getSelectorItems, toString
-
-
-
-
Constructor Detail
-
CssSelector
public CssSelector(java.util.List<ICssSelectorItem> selectorItems)
Creates a newCssSelector
instance.- Parameters:
selectorItems
- the selector items
-
CssSelector
public CssSelector(java.lang.String selector)
Creates a newCssSelector
instance.- Parameters:
selector
- the selector
-
-
Method Detail
-
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 nodelastSelectorItemInd
- the index of the last selector- Returns:
- true, if there's a match
-
-