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
ICssSelectorimplementation 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 newCssSelectorinstance.CssSelector(java.util.List<ICssSelectorItem> selectorItems)Creates a newCssSelectorinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(INode element)Checks if a node matches the selector.private booleanmatches(INode element, int lastSelectorItemInd)Checks if a node matches the selector.booleannotMatches(INode element)Checks if the node not matches all the selectors.-
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 newCssSelectorinstance.- Parameters:
selectorItems- the selector items
-
CssSelector
public CssSelector(java.lang.String selector)
Creates a newCssSelectorinstance.- Parameters:
selector- the selector
-
-
Method Detail
-
matches
public boolean matches(INode element)
Description copied from interface:ICssSelectorChecks if a node matches the selector.- Parameters:
element- the node- Returns:
- true, if the selector is a match for the node
-
notMatches
public boolean notMatches(INode element)
Checks if the node not matches all the selectors.- Parameters:
element- the node- Returns:
- true, if node doesn't match all the selectors
-
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
-
-