java.lang.Object
org.xbib.content.xml.json.JsonSaxAdapter
Converts JSON to SAX events. It can be used either directly
ContentHandler ch = ...;
JsonSaxAdapter service = new JsonSaxAdapter("{\"name\":\"value\"}", ch);
service.parse();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
InputSource source = new InputSource(...);
Result result = ...;
transformer.transform(new SAXSource(new JsonXmlReader(),source), result);
-
Constructor Summary
ConstructorsConstructorDescriptionJsonSaxAdapter(com.fasterxml.jackson.core.JsonParser jsonParser, ContentHandler contentHandler) JsonSaxAdapter(Reader reader, ContentHandler contentHandler) -
Method Summary
-
Constructor Details
-
JsonSaxAdapter
- Throws:
IOException
-
JsonSaxAdapter
public JsonSaxAdapter(com.fasterxml.jackson.core.JsonParser jsonParser, ContentHandler contentHandler)
-
-
Method Details
-
root
-
context
-
parse
Method parses JSON and emits SAX events.- Throws:
IOException- if parse input/output failsSAXException- if parse fails
-