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

Method contains

src/main/java/org/jsoup/select/QueryParser.java:444–455  ·  view source on GitHub ↗
(boolean own)

Source from the content-addressed store, hash-verified

442
443 // pseudo selector :contains(text), containsOwn(text)
444 private Evaluator contains(boolean own) {
445 String query = own ? ":containsOwn" : ":contains";
446 String searchText = TokenQueue.unescape(consumeParens());
447 Validate.notEmpty(searchText, query + "(text) query must not be empty");
448
449 if (inNodeContext)
450 return new NodeEvaluator.ContainsValue(searchText);
451
452 return own
453 ? new Evaluator.ContainsOwnText(searchText)
454 : new Evaluator.ContainsText(searchText);
455 }
456
457 private Evaluator containsWholeText(boolean own) {
458 String query = own ? ":containsWholeOwnText" : ":containsWholeText";

Callers 15

parsePseudoSelectorMethod · 0.95
fetchURlMethod · 0.80
handlesEmptyRedirectMethod · 0.80
fetchToW3cMethod · 0.80
progressListenerMethod · 0.80
uncaughtExceptionMethod · 0.80

Calls 3

unescapeMethod · 0.95
consumeParensMethod · 0.95
notEmptyMethod · 0.95

Tested by 15

fetchURlMethod · 0.64
handlesEmptyRedirectMethod · 0.64
fetchToW3cMethod · 0.64
progressListenerMethod · 0.64
uncaughtExceptionMethod · 0.64
handleMethod · 0.64