|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JSONHandlerFactory
Factory that generates handlers for producing and parsing JSON events in a stream based manner.
Field Summary | |
---|---|
static java.lang.String |
ATTR_CLASS
name of the class attribute used for instantiation |
static java.lang.String |
DEFAULT_EXTENSION_ID
ID of the JSONHandlerFactory default extension |
static java.lang.String |
EXTENSION_POINT_ID
ID of the JSONHandlerFactory extension point |
Method Summary | |
---|---|
DefaultJsonContentHandler |
createJsonContentHandler(JsonContentHandler handler)
Creates a DefaultJsonContentHandler used to write JSON content
onto an existing JsonContentHandler . |
DefaultJsonContentHandler |
createJsonContentHandler(java.io.OutputStream writer,
java.nio.charset.Charset charset)
Creates a DefaultJsonContentHandler used to write JSON content
onto a target OutputStream . |
DefaultJsonContentHandler |
createJsonContentHandler(java.io.Writer writer)
Creates a DefaultJsonContentHandler used to write JSON content
onto a target Writer . |
JsonProducer |
createJsonCopy(JsonProducer aProducer)
Construct a producer that is a copy of the content the other producer generates |
JsonDocumentContentHandler |
createJsonDocumentContentHandler()
Constructs a JsonContentHandler that builds an JSON object graph. |
JSONHandler |
createJSONHandler(java.io.OutputStream out)
Deprecated. use createJsonContentHandler(OutputStream, Charset)
instead |
JSONHandler |
createJSONHandler(java.io.Writer writer)
Deprecated. use createJsonContentHandler(Writer) instead |
JsonParserOutputStream |
createJsonParserOutputStream(JsonContentHandler handler,
java.nio.charset.Charset charset,
int bufferSize)
Creates a JSON parser that sends the event to the JsonContentHandler . |
JsonParserReader |
createJsonParserReader(java.io.Reader in)
Constructs a pull parser for JSON content. |
JsonParserReader |
createJsonParserReader(java.io.Reader in,
int bufferSize)
Constructs a pull parser for JSON content. |
JsonParserWriter |
createJsonParserWriter(JsonContentHandler handler)
Creates a JSON parser that sends the event to the JsonContentHandler . |
JsonProducer |
createJsonProducer(org.xml.sax.InputSource is)
Construct a producer that copies the content of the input source to the target |
JsonProducer |
createJsonProducer(java.io.InputStream is,
java.nio.charset.Charset charset)
Construct a producer that copies the content of the stream to the target |
JsonProducer |
createJsonProducer(java.io.InputStream is,
java.nio.charset.Charset charset,
int bufferSize)
Construct a producer that copies the content of the stream to the target |
JsonProducer |
createJsonProducer(JsonParserReader aReader)
Construct a producer that copies the content of the reader |
JsonProducer |
createJsonProducer(java.lang.Object jsonDocument)
Construct a producer that transforms the JSON document as returned by JsonDocumentContentHandler.getDocument() into a sequence of JSON
events. |
JsonProducer |
createJsonProducer(java.io.Reader reader)
Construct a producer that copies the content of the reader to the target |
JsonProducer |
createJsonProducer(java.io.Reader reader,
int bufferSize)
Construct a producer that copies the content of the reader to the target |
JSONReader |
createJSONReader(JSONHandler handler)
Deprecated. use createJsonParserReader(Reader) instead |
JsonRecorder |
createJsonRecorder()
Creates an object that can record JSON callbacks and that can then playback this sequence to another handler at a later point in time. |
JsonRecorder |
createJsonRecorder(int bufferSize)
Creates an object that can record JSON callbacks and that can then playback this sequence to another handler at a later point in time. |
org.xml.sax.ContentHandler |
getContentHandler(JsonContentHandler aHandler)
Create a ContentHandler that can be used to convert XML events
into JSON events. |
org.xml.sax.ContentHandler |
getContentHandler(JsonSchema aSchema,
JsonContentHandler aHandler)
Create a ContentHandler that can be used to convert XML events
into JSON events. |
Field Detail |
---|
static final java.lang.String ATTR_CLASS
static final java.lang.String DEFAULT_EXTENSION_ID
static final java.lang.String EXTENSION_POINT_ID
Method Detail |
---|
DefaultJsonContentHandler createJsonContentHandler(JsonContentHandler handler) throws java.io.IOException
DefaultJsonContentHandler
used to write JSON content
onto an existing JsonContentHandler
.
handler
- the handler that receives the content, not null
null
java.io.IOException
DefaultJsonContentHandler createJsonContentHandler(java.io.OutputStream writer, java.nio.charset.Charset charset) throws java.io.IOException
DefaultJsonContentHandler
used to write JSON content
onto a target OutputStream
. The resulting handler supports the
XMLPropertyProvider interface to enable beautification.
writer
- the writer that receives the content, not null
charset
- the characterset used to create the object
null
java.io.IOException
Constants#KEY_INDENT
,
Constants#KEY_INDENT_AMOUNT
DefaultJsonContentHandler createJsonContentHandler(java.io.Writer writer) throws java.io.IOException
DefaultJsonContentHandler
used to write JSON content
onto a target Writer
. The resulting handler supports the
XMLPropertyProvider interface to enable beautification.
writer
- the writer that receives the content, not null
null
java.io.IOException
Constants#KEY_INDENT
,
Constants#KEY_INDENT_AMOUNT
JsonProducer createJsonCopy(JsonProducer aProducer) throws java.io.IOException
aProducer
- the JSON producer
java.io.IOException
JsonDocumentContentHandler createJsonDocumentContentHandler() throws java.io.IOException
JsonContentHandler
that builds an JSON object graph.
null
java.io.IOException
@Deprecated JSONHandler createJSONHandler(java.io.OutputStream out) throws java.io.IOException
createJsonContentHandler(OutputStream, Charset)
instead
JSONHandler
that allows to convert JSON events
into characters that are written to the given writer.
writer
- A writer to which the events should be converted.
JSONHandler
that writes to the given writer.
java.io.IOException
@Deprecated JSONHandler createJSONHandler(java.io.Writer writer) throws java.io.IOException
createJsonContentHandler(Writer)
instead
JSONHandler
that allows to convert JSON events
into characters that are written to the given writer.
writer
- A writer to which the events should be converted.
JSONHandler
that writes to the given writer.
java.io.IOException
JsonParserOutputStream createJsonParserOutputStream(JsonContentHandler handler, java.nio.charset.Charset charset, int bufferSize) throws java.io.IOException
JsonContentHandler
. The parser is already initialized but the
parsing process must be completed by calling Closeable.close()
on
the parser.
handler
- handler that receives the events, not null
charset
- characterset used to parse the JSON markup. If
null
this defaults to UTF8bufferSize
- buffer size used during character conversion, a value of
<=0
indicates that a default buffer size will
be used
null
java.io.IOException
JsonParserReader createJsonParserReader(java.io.Reader in) throws java.io.IOException
in
- the original reader to parse the content from
java.io.IOException
JsonParserReader createJsonParserReader(java.io.Reader in, int bufferSize) throws java.io.IOException
in
- the original reader to parse the content frombufferSize
- the buffer size
java.io.IOException
JsonParserWriter createJsonParserWriter(JsonContentHandler handler) throws java.io.IOException
JsonContentHandler
. The parser is already initialized but the
parsing process must be completed by calling Closeable.close()
on
the parser.
handler
- handler that receives the events, not null
null
java.io.IOException
JsonProducer createJsonProducer(org.xml.sax.InputSource is) throws java.io.IOException
is
- the source of the JSON data
java.io.IOException
JsonProducer createJsonProducer(java.io.InputStream is, java.nio.charset.Charset charset) throws java.io.IOException
is
- the source of the JSON datacharset
- the characterset
java.io.IOException
JsonProducer createJsonProducer(java.io.InputStream is, java.nio.charset.Charset charset, int bufferSize) throws java.io.IOException
is
- the source of the JSON datacharset
- the charactersetbufferSize
- the buffer size
java.io.IOException
JsonProducer createJsonProducer(JsonParserReader aReader) throws java.io.IOException
aReader
- the reader to copy from
java.io.IOException
JsonProducer createJsonProducer(java.lang.Object jsonDocument) throws java.io.IOException
JsonDocumentContentHandler.getDocument()
into a sequence of JSON
events. This method can also convert java script objects as returned by a
ScriptEngine
into JSON callbacks.
jsonDocument
- the document
java.io.IOException
JsonProducer createJsonProducer(java.io.Reader reader) throws java.io.IOException
reader
- the source of the JSON data
java.io.IOException
JsonProducer createJsonProducer(java.io.Reader reader, int bufferSize) throws java.io.IOException
reader
- the source of the JSON databufferSize
- the buffer size
java.io.IOException
@Deprecated JSONReader createJSONReader(JSONHandler handler) throws java.io.IOException
createJsonParserReader(Reader)
instead
JSONReader
that allows to convert characters read
from the given reader into JSON events
handler
- The handler where the events will be delegated to.
JSONHandler
that reads from the given reader.
java.io.IOException
JsonRecorder createJsonRecorder() throws java.io.IOException
java.io.IOException
JsonRecorder createJsonRecorder(int bufferSize) throws java.io.IOException
bufferSize
- size of the string buffer used for json strings.
java.io.IOException
org.xml.sax.ContentHandler getContentHandler(JsonContentHandler aHandler) throws java.io.IOException
ContentHandler
that can be used to convert XML events
into JSON events. Use the optional XMLPropertyProvider interface on the
ContentHandler
to associate a JsonSchema
with the
handler.
aHandler
- the target json handler
java.io.IOException
org.xml.sax.ContentHandler getContentHandler(JsonSchema aSchema, JsonContentHandler aHandler) throws java.io.IOException
ContentHandler
that can be used to convert XML events
into JSON events. Use the optional XMLPropertyProvider interface on the
ContentHandler
to associate a JsonSchema
with the
handler.
aSchema
- the JSON schema that contols the XML to JSON conversionaHandler
- the target json handler
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |