|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.commons.util.io.json.JsonGenerator
public class JsonGenerator
JSON text generator.
This class provides some methods for generating JSON object representation. It uses a factory to deal with the actual object classes.
| Nested Class Summary | |
|---|---|
static class |
JsonGenerator.Generator
Generator base class. |
static class |
JsonGenerator.StringBuilderGenerator
StringBuilder generator class. |
static class |
JsonGenerator.StringGenerator
String generator class. |
static class |
JsonGenerator.WriterGenerator
Writer generator class. |
| Constructor Summary | |
|---|---|
JsonGenerator()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
toJson(JsonFactory factory,
java.lang.Object value)
Convert an object hierarchy to a JSON text. |
static java.lang.String |
toJson(JsonFactory factory,
java.lang.Object value,
boolean compact)
Convert an object hierarchy to a JSON text. |
static java.lang.StringBuilder |
toJson(JsonFactory factory,
java.lang.StringBuilder b,
java.lang.Object value,
boolean compact)
Convert an object hierarchy to a JSON text and append it to an existing String builder. |
static void |
toJson(JsonFactory factory,
java.io.Writer writer,
java.lang.Object value,
boolean compact)
Convert an object hierarchy to a JSON text in a writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonGenerator()
| Method Detail |
|---|
public static java.lang.String toJson(JsonFactory factory,
java.lang.Object value)
throws java.io.IOException,
JsonException
factory - the object factoryvalue - the convert to serialize
java.io.IOException
JsonException
public static java.lang.String toJson(JsonFactory factory,
java.lang.Object value,
boolean compact)
throws java.io.IOException,
JsonException
factory - the object factoryvalue - the convert to serializecompact - indicates if the string should be in a compact format
java.io.IOException
JsonException
public static java.lang.StringBuilder toJson(JsonFactory factory,
java.lang.StringBuilder b,
java.lang.Object value,
boolean compact)
throws java.io.IOException,
JsonException
factory - the object factoryb - the StringBuilder to append the text tovalue - the convert to serializecompact - indicates if the string should be in a compact format
java.io.IOException
JsonException
public static void toJson(JsonFactory factory,
java.io.Writer writer,
java.lang.Object value,
boolean compact)
throws java.io.IOException,
JsonException
factory - the object factorywriter - the writer to write tovalue - the convert to serializecompact - indicates if the string should be in a compact format
java.io.IOException
JsonException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||