MCPcopy Create free account
hub / github.com/jhy/jsoup / parse

Method parse

src/main/java/org/jsoup/select/QueryParser.java:54–60  ·  view source on GitHub ↗

Parse a CSS query into an Evaluator. If you are evaluating the same query repeatedly, it may be more efficient to parse it once and reuse the Evaluator. @param query CSS query @return Evaluator @see Selector selector query syntax @throws Selector.SelectorParseException if t

(String query)

Source from the content-addressed store, hash-verified

52 @throws Selector.SelectorParseException if the CSS query is invalid
53 */
54 public static Evaluator parse(String query) {
55 try (QueryParser p = new QueryParser(query)) {
56 return p.parse();
57 } catch (IllegalArgumentException e) {
58 throw new Selector.SelectorParseException(e.getMessage());
59 }
60 }
61
62 /**
63 Parse the query. We use this simplified expression of the grammar:

Callers 15

testEvalMethodsMethod · 0.95
selectMethod · 0.95
asDocumentMethod · 0.95
sexprMethod · 0.95
multiThreadHasMethod · 0.95
exceptOnEmptySelectorMethod · 0.95
exceptOnNullSelectorMethod · 0.95

Calls 5

parseSelectorGroupMethod · 0.95
consumeWhitespaceMethod · 0.80
remainderMethod · 0.80
parseMethod · 0.65
isEmptyMethod · 0.45

Tested by 15

testEvalMethodsMethod · 0.76
selectMethod · 0.76
asDocumentMethod · 0.76
sexprMethod · 0.76
multiThreadHasMethod · 0.76
exceptOnEmptySelectorMethod · 0.76
exceptOnNullSelectorMethod · 0.76