public class JsonSaxAdapter extends Object
ContentHandler ch = ...;
JsonSaxAdapter adapter = new JsonSaxAdapter(JsonSaxAdapterTest.JSON, ch);
adapter.parse();
or using JsonXmlReader
Transformer transformer = TransformerFactory.newInstance().newTransformer();
InputSource source = new InputSource(...);
Result result = ...;
transformer.transform(new SAXSource(new JsonXmlReader(),source), result);
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonSaxAdapter.ParserException |
| Constructor and Description |
|---|
JsonSaxAdapter(org.codehaus.jackson.JsonParser jsonParser,
ContentHandler contentHandler) |
JsonSaxAdapter(org.codehaus.jackson.JsonParser jsonParser,
ContentHandler contentHandler,
String namespaceUri) |
JsonSaxAdapter(org.codehaus.jackson.JsonParser jsonParser,
ContentHandler contentHandler,
String namespaceUri,
boolean addTypeAttributes) |
JsonSaxAdapter(String json,
ContentHandler contentHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getCurrentTokenType() |
protected Attributes |
getTypeAttributes() |
void |
parse()
Method parses JSON and emits SAX events.
|
public JsonSaxAdapter(String json, ContentHandler contentHandler)
public JsonSaxAdapter(org.codehaus.jackson.JsonParser jsonParser,
ContentHandler contentHandler)
public JsonSaxAdapter(org.codehaus.jackson.JsonParser jsonParser,
ContentHandler contentHandler,
String namespaceUri)
public JsonSaxAdapter(org.codehaus.jackson.JsonParser jsonParser,
ContentHandler contentHandler,
String namespaceUri,
boolean addTypeAttributes)
public void parse()
throws JsonSaxAdapter.ParserException
JsonSaxAdapter.ParserExceptionprotected Attributes getTypeAttributes()
protected String getCurrentTokenType()
Copyright © 2013. All Rights Reserved.