Class CssSelectorParser
java.lang.Object
com.itextpdf.styledxmlparser.css.parse.CssSelectorParser
Utilities class to parse a CSS selector.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendPseudoSelector(List<ICssSelectorItem> selectorItems, String pseudoSelector, Matcher match, String source) Resolves a pseudo selector and appends it to list.private static StringhandleBracketsOfPseudoSelector(String pseudoSelector, Matcher match, String source) Resolves a pseudo selector if it contains brackets.static List<ICssSelectorItem> parseSelectorItems(String selector) Parses the selector items.
-
Field Details
-
LEGACY_PSEUDO_ELEMENTS
-
SELECTOR_PATTERN_STR
-
selectorPattern
The pattern for selectors.
-
-
Constructor Details
-
CssSelectorParser
private CssSelectorParser()Creates a newCssSelectorParserinstance.
-
-
Method Details
-
parseSelectorItems
Parses the selector items.- Parameters:
selector- the selectors in the form of aString- Returns:
- the resulting list of
ICssSelectorItem
-
appendPseudoSelector
private static void appendPseudoSelector(List<ICssSelectorItem> selectorItems, String pseudoSelector, Matcher match, String source) Resolves a pseudo selector and appends it to list.- Parameters:
selectorItems- list of items to which new selector will be added topseudoSelector- the pseudo selectormatch- the correspondingMatcher.source- is the original source
-
handleBracketsOfPseudoSelector
private static String handleBracketsOfPseudoSelector(String pseudoSelector, Matcher match, String source) Resolves a pseudo selector if it contains brackets. Updates internal state ofMatcherif necessary.- Parameters:
pseudoSelector- the pseudo selectormatch- the correspondingMatcher.source- is the original source
-