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 void
appendPseudoSelector
(List<ICssSelectorItem> selectorItems, String pseudoSelector, Matcher match, String source) Resolves a pseudo selector and appends it to list.private static String
handleBracketsOfPseudoSelector
(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
Set of legacy pseudo elements (first-line, first-letter, before, after). -
SELECTOR_PATTERN_STR
The pattern string for selectors.- See Also:
-
selectorPattern
The pattern for selectors.
-
-
Constructor Details
-
CssSelectorParser
private CssSelectorParser()Creates a newCssSelectorParser
instance.
-
-
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 ofMatcher
if necessary.- Parameters:
pseudoSelector
- the pseudo selectormatch
- the correspondingMatcher
.source
- is the original source
-