Class JSONToJsoup

java.lang.Object
com.attribyte.json.JSONToJsoup

public class JSONToJsoup extends Object
Parses JSON to a tree of jsoup nodes.

Among other uses, the parsed tree may be queried using jsoup's Selector system.

Author:
Matt Hamer, Attribyte, LLC
  • Constructor Details

    • JSONToJsoup

      public JSONToJsoup()
  • Method Details

    • parse

      public static org.jsoup.nodes.Element parse(Reader charStream, String rootElementName, JSONToJsoup.NullBehavior nullBehavior) throws IOException
      Parse a JSON document to jsoup nodes.
      Parameters:
      charStream - The JSON character stream.
      rootElementName - The root element name.
      nullBehavior - The behavior when handling null values.
      Returns:
      The root element.
      Throws:
      IOException - on input exception.
    • parse

      public static org.jsoup.nodes.Element parse(Reader charStream, org.jsoup.nodes.Element rootElem, JSONToJsoup.NullBehavior nullBehavior) throws IOException
      Parse a JSON document to jsoup nodes.
      Parameters:
      charStream - The JSON character stream.
      rootElem - The root element.
      nullBehavior - The behavior when handling null values.
      Returns:
      The root element.
      Throws:
      IOException - on input exception.