Package com.attribyte.json
Class JSONToJsoup
java.lang.Object
com.attribyte.json.JSONToJsoup
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe behavior when null values are encountered. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jsoup.nodes.Elementparse(Reader charStream, String rootElementName, JSONToJsoup.NullBehavior nullBehavior) Parse a JSON document to jsoup nodes.static org.jsoup.nodes.Elementparse(Reader charStream, org.jsoup.nodes.Element rootElem, JSONToJsoup.NullBehavior nullBehavior) Parse a JSON document to jsoup nodes.
-
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 handlingnullvalues.- 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 handlingnullvalues.- Returns:
- The root element.
- Throws:
IOException- on input exception.
-