|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DefaultJsonContentHandler
Convenience interface to the JsonContentHandler
that allows to write
high-level java objects.
JsonContentHandler.startDocument()
and the
last call JsonContentHandler.endDocument()
handler.startDocument(); handler.startObject(); handler.startMember("Image"); handler.startObject(); handler.jsonMember("Width", 800); handler.jsonMember("Height", 600); handler.jsonMember("Title", "View from 15th Floor"); handler.startMember("Thumbnail"); handler.startObject(); handler.jsonMember("Url", "http://www.example.com/image/481989943"); handler.jsonMember("Height", 125); handler.jsonMember("Width", "100"); handler.endObject(); handler.endMember(); handler.jsonMember("IDs", new int[] { 116, 943, 234, 38793 }); handler.endObject(); handler.endObject(); handler.endDocument();
Field Summary |
---|
Fields inherited from interface com.ibm.portal.streaming.json.JsonContentHandlerEx |
---|
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Method Summary | |
---|---|
java.io.OutputStream |
getBase64OutputStream()
OutputStream used to stream a string value encoded as base64,
similar to the value(String) method. |
DefaultJsonContentHandler |
getInnerJsonContentHandler()
Returns a JsonContentHandler that ignores calls to
JsonContentHandler.startDocument() and
JsonContentHandler.endDocument() but simply passes on all other
calls to the DefaultContentHandler . |
java.io.Writer |
getWriter()
Writer used to stream a string value, similar to the value(String) method. |
void |
jsonArray(boolean[] value)
|
void |
jsonArray(java.lang.Boolean[] value)
|
void |
jsonArray(byte[] value)
|
void |
jsonArray(java.lang.Byte[] value)
|
void |
jsonArray(java.util.Date[] value)
Writes an array of dates in RFC 1123 forma |
void |
jsonArray(double[] value)
|
void |
jsonArray(java.lang.Double[] value)
|
void |
jsonArray(float[] value)
|
void |
jsonArray(java.lang.Float[] value)
|
void |
jsonArray(int[] value)
|
void |
jsonArray(java.lang.Integer[] value)
|
void |
jsonArray(java.util.Locale[] value)
Writes an array of locales in RFC 4646 format |
void |
jsonArray(long[] value)
|
void |
jsonArray(java.lang.Long[] value)
|
void |
jsonArray(java.lang.Object[] value)
|
void |
jsonArray(javax.xml.namespace.QName[] value)
Writes an array of QName objects |
void |
jsonArray(short[] value)
|
void |
jsonArray(java.lang.Short[] value)
|
void |
jsonArray(java.lang.String[] value)
|
void |
jsonBoolean(boolean value)
|
void |
jsonBoolean(java.lang.Boolean value)
|
void |
jsonCollection(java.util.Collection<?> value)
|
void |
jsonDate(java.util.Date value)
Writes a date in RFC 1123 format |
void |
jsonDate(long value)
Writes a date in RFC 1123 format |
void |
jsonLocale(java.util.Locale value)
Writes a locale in RFC 4646 format |
void |
jsonMap(java.util.Map<java.lang.String,?> value)
|
void |
jsonMember(java.lang.String name)
|
void |
jsonMember(java.lang.String name,
boolean value)
|
void |
jsonMember(java.lang.String name,
java.lang.Boolean value)
|
void |
jsonMember(java.lang.String name,
boolean[] value)
|
void |
jsonMember(java.lang.String name,
java.lang.Boolean[] value)
|
void |
jsonMember(java.lang.String name,
java.util.Collection<?> value)
|
void |
jsonMember(java.lang.String name,
java.util.Date value)
|
void |
jsonMember(java.lang.String name,
java.util.Date[] value)
|
void |
jsonMember(java.lang.String name,
double value)
|
void |
jsonMember(java.lang.String name,
java.lang.Double value)
|
void |
jsonMember(java.lang.String name,
double[] value)
|
void |
jsonMember(java.lang.String name,
java.lang.Double[] value)
|
void |
jsonMember(java.lang.String name,
float value)
|
void |
jsonMember(java.lang.String name,
java.lang.Float value)
|
void |
jsonMember(java.lang.String name,
float[] value)
|
void |
jsonMember(java.lang.String name,
java.lang.Float[] value)
|
void |
jsonMember(java.lang.String name,
int value)
|
void |
jsonMember(java.lang.String name,
int[] value)
|
void |
jsonMember(java.lang.String name,
java.lang.Integer value)
|
void |
jsonMember(java.lang.String name,
java.lang.Integer[] value)
|
void |
jsonMember(java.lang.String name,
java.util.Locale value)
|
void |
jsonMember(java.lang.String name,
java.util.Locale[] value)
|
void |
jsonMember(java.lang.String name,
long value)
|
void |
jsonMember(java.lang.String name,
java.lang.Long value)
|
void |
jsonMember(java.lang.String name,
long[] value)
|
void |
jsonMember(java.lang.String name,
java.lang.Long[] value)
|
void |
jsonMember(java.lang.String name,
java.util.Map<java.lang.String,?> value)
|
void |
jsonMember(java.lang.String name,
java.lang.Object value)
|
void |
jsonMember(java.lang.String name,
java.lang.Object[] value)
|
void |
jsonMember(java.lang.String name,
javax.xml.namespace.QName value)
|
void |
jsonMember(java.lang.String name,
javax.xml.namespace.QName[] value)
|
void |
jsonMember(java.lang.String name,
java.lang.String value)
|
void |
jsonMember(java.lang.String name,
java.lang.String[] value)
|
void |
jsonMember(java.lang.String name,
java.lang.String value,
int off,
int len)
|
void |
jsonNull()
|
void |
jsonNumber(byte value)
|
void |
jsonNumber(java.lang.Byte value)
|
void |
jsonNumber(double value)
|
void |
jsonNumber(java.lang.Double value)
|
void |
jsonNumber(float value)
|
void |
jsonNumber(java.lang.Float value)
|
void |
jsonNumber(int value)
|
void |
jsonNumber(java.lang.Integer value)
|
void |
jsonNumber(long value)
|
void |
jsonNumber(java.lang.Long value)
|
void |
jsonNumber(short value)
|
void |
jsonNumber(java.lang.Short value)
|
void |
jsonObject(java.lang.Object obj)
|
void |
jsonQName(javax.xml.namespace.QName value)
Writes a QName |
java.io.Writer |
jsonString()
Starts a JSON string and returns a writer that can be used to stream the content of the string. |
void |
jsonString(java.lang.String value)
|
void |
jsonString(java.lang.String value,
int off,
int len)
|
void |
value(java.lang.Boolean value)
|
void |
value(boolean[] value)
|
void |
value(java.lang.Boolean[] value)
|
void |
value(java.lang.Byte value)
|
void |
value(byte[] value)
|
void |
value(java.lang.Byte[] value)
|
void |
value(char[] cbuf)
|
void |
value(java.util.Collection<?> value)
|
void |
value(java.util.Date value)
Writes the date in JSON format according to the IETF standard (RFC 1123 Section 5.2.14 and elsewhere) date syntax: "Mon, 25 Dec 1995 13:30:00 GMT". |
void |
value(java.util.Date[] value)
Writes a sequence of dates in RFC 1123 format. |
void |
value(java.lang.Double value)
|
void |
value(double[] value)
|
void |
value(java.lang.Double[] value)
|
void |
value(java.lang.Float value)
|
void |
value(float[] value)
|
void |
value(java.lang.Float[] value)
|
void |
value(int[] value)
|
void |
value(java.lang.Integer value)
|
void |
value(java.lang.Integer[] value)
|
void |
value(java.util.Locale value)
Writes the locale in RFC 4646 format |
void |
value(java.util.Locale[] value)
Writes a sequence of locales in RFC 4646 format |
void |
value(java.lang.Long value)
|
void |
value(long[] value)
|
void |
value(java.lang.Long[] value)
|
void |
value(java.util.Map<java.lang.String,?> value)
|
void |
value(java.lang.Object value)
|
void |
value(java.lang.Object[] value)
|
void |
value(javax.xml.namespace.QName value)
|
void |
value(javax.xml.namespace.QName[] value)
|
void |
value(java.lang.Short value)
|
void |
value(short[] value)
|
void |
value(java.lang.Short[] value)
|
void |
value(java.lang.String value)
|
void |
value(java.lang.String[] value)
|
void |
value(java.lang.String value,
int off,
int len)
|
Methods inherited from interface com.ibm.portal.streaming.json.JsonContentHandlerEx |
---|
processingInstruction |
Methods inherited from interface com.ibm.portal.streaming.json.JsonContentHandler |
---|
endArray, endBoolean, endDocument, endMember, endNull, endNumber, endObject, endString, startArray, startBoolean, startDocument, startMember, startNull, startNumber, startObject, startString, value, value, value, value |
Method Detail |
---|
java.io.OutputStream getBase64OutputStream() throws java.io.IOException
OutputStream
used to stream a string value encoded as base64,
similar to the value(String)
method. Make sure to close
OutputStream.close()
to complete writing the value to flush
potential buffers.
java.io.IOException
DefaultJsonContentHandler getInnerJsonContentHandler()
JsonContentHandler
that ignores calls to
JsonContentHandler.startDocument()
and
JsonContentHandler.endDocument()
but simply passes on all other
calls to the DefaultContentHandler
. This inner content handler is
convenient to embed a second JSON document into the document represented
by the content handler.
JsonContentHandler
implementation that ignores document
start and end calls.java.io.Writer getWriter() throws java.io.IOException
value(String)
method. Make sure to close Writer.close()
to complete writing the value to flush potential buffers.
java.io.IOException
void jsonArray(boolean[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Boolean[] value) throws java.io.IOException
java.io.IOException
void jsonArray(byte[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Byte[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.util.Date[] value) throws java.io.IOException
value
- the date array, may be null
java.io.IOException
void jsonArray(double[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Double[] value) throws java.io.IOException
java.io.IOException
void jsonArray(float[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Float[] value) throws java.io.IOException
java.io.IOException
void jsonArray(int[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Integer[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.util.Locale[] value) throws java.io.IOException
value
- the locale array, may be null
java.io.IOException
void jsonArray(long[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Long[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Object[] value) throws java.io.IOException
java.io.IOException
void jsonArray(javax.xml.namespace.QName[] value) throws java.io.IOException
QName
objects
value
- the array of QName
objects
java.io.IOException
void jsonArray(short[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.Short[] value) throws java.io.IOException
java.io.IOException
void jsonArray(java.lang.String[] value) throws java.io.IOException
java.io.IOException
void jsonBoolean(boolean value) throws java.io.IOException
java.io.IOException
void jsonBoolean(java.lang.Boolean value) throws java.io.IOException
java.io.IOException
void jsonCollection(java.util.Collection<?> value) throws java.io.IOException
java.io.IOException
void jsonDate(java.util.Date value) throws java.io.IOException
value
- the date object, may be null
java.io.IOException
void jsonDate(long value) throws java.io.IOException
value
- the number of milliseconds
java.io.IOException
void jsonLocale(java.util.Locale value) throws java.io.IOException
value
- the locale, may be null
java.io.IOException
void jsonMap(java.util.Map<java.lang.String,?> value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, boolean value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Boolean value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, boolean[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Boolean[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.util.Collection<?> value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.util.Date value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.util.Date[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, double value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Double value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, double[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Double[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, float value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Float value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, float[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Float[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, int value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, int[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Integer value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Integer[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.util.Locale value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.util.Locale[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, long value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Long value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, long[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Long[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.util.Map<java.lang.String,?> value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Object value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.Object[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, javax.xml.namespace.QName value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, javax.xml.namespace.QName[] value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.String value) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.String value, int off, int len) throws java.io.IOException
java.io.IOException
void jsonMember(java.lang.String name, java.lang.String[] value) throws java.io.IOException
java.io.IOException
void jsonNull() throws java.io.IOException
java.io.IOException
void jsonNumber(byte value) throws java.io.IOException
java.io.IOException
void jsonNumber(java.lang.Byte value) throws java.io.IOException
java.io.IOException
void jsonNumber(double value) throws java.io.IOException
java.io.IOException
void jsonNumber(java.lang.Double value) throws java.io.IOException
java.io.IOException
void jsonNumber(float value) throws java.io.IOException
java.io.IOException
void jsonNumber(java.lang.Float value) throws java.io.IOException
java.io.IOException
void jsonNumber(int value) throws java.io.IOException
java.io.IOException
void jsonNumber(java.lang.Integer value) throws java.io.IOException
java.io.IOException
void jsonNumber(long value) throws java.io.IOException
java.io.IOException
void jsonNumber(java.lang.Long value) throws java.io.IOException
java.io.IOException
void jsonNumber(short value) throws java.io.IOException
java.io.IOException
void jsonNumber(java.lang.Short value) throws java.io.IOException
java.io.IOException
void jsonObject(java.lang.Object obj) throws java.io.IOException
java.io.IOException
void jsonQName(javax.xml.namespace.QName value) throws java.io.IOException
QName
value
- the QName object, may be null
java.io.IOException
java.io.Writer jsonString() throws java.io.IOException
Writer.close()
to finish
writing.
java.io.IOException
void jsonString(java.lang.String value) throws java.io.IOException
java.io.IOException
void jsonString(java.lang.String value, int off, int len) throws java.io.IOException
java.io.IOException
void value(java.lang.Boolean value) throws java.io.IOException
java.io.IOException
void value(boolean[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Boolean[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Byte value) throws java.io.IOException
java.io.IOException
void value(byte[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Byte[] value) throws java.io.IOException
java.io.IOException
void value(char[] cbuf) throws java.io.IOException
java.io.IOException
void value(java.util.Collection<?> value) throws java.io.IOException
java.io.IOException
void value(java.util.Date value) throws java.io.IOException
value
- the date object, not null
java.io.IOException
void value(java.util.Date[] value) throws java.io.IOException
value
- the date object array, not null
java.io.IOException
void value(java.lang.Double value) throws java.io.IOException
java.io.IOException
void value(double[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Double[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Float value) throws java.io.IOException
java.io.IOException
void value(float[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Float[] value) throws java.io.IOException
java.io.IOException
void value(int[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Integer value) throws java.io.IOException
java.io.IOException
void value(java.lang.Integer[] value) throws java.io.IOException
java.io.IOException
void value(java.util.Locale value) throws java.io.IOException
value
- the locale object, not null
java.io.IOException
void value(java.util.Locale[] value) throws java.io.IOException
value
- the locale object array, not null
java.io.IOException
void value(java.lang.Long value) throws java.io.IOException
java.io.IOException
void value(long[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Long[] value) throws java.io.IOException
java.io.IOException
void value(java.util.Map<java.lang.String,?> value) throws java.io.IOException
java.io.IOException
void value(java.lang.Object value) throws java.io.IOException
java.io.IOException
void value(java.lang.Object[] value) throws java.io.IOException
java.io.IOException
void value(javax.xml.namespace.QName value) throws java.io.IOException
java.io.IOException
void value(javax.xml.namespace.QName[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Short value) throws java.io.IOException
java.io.IOException
void value(short[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.Short[] value) throws java.io.IOException
java.io.IOException
void value(java.lang.String value) throws java.io.IOException
java.io.IOException
void value(java.lang.String value, int off, int len) throws java.io.IOException
java.io.IOException
void value(java.lang.String[] value) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |