Class QueryParser

java.lang.Object
org.jsoup.select.QueryParser
All Implemented Interfaces:
AutoCloseable

public class QueryParser extends Object implements AutoCloseable
Parses a CSS selector into an Evaluator tree.
  • Method Details

    • parse

      public static Evaluator parse(String query)
      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.

      A query may contain at most 128 combinators, node selectors, and :has(), :is(), or :not() expressions in total, across all selector alternatives.

      Parameters:
      query - CSS query
      Returns:
      Evaluator
      Throws:
      Selector.SelectorParseException - if the CSS query is invalid or exceeds the complexity limit
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable