|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JsonGeneratorFactory
Factory to create JsonGenerator
instances. If a factory
instance is configured with some configuration, that would be
used to configure the created generator instances.
JsonGenerator
can also be created using Json
's
createGenerator
methods. If multiple generator instances are created,
then creating them using a generator factory is preferred.
For example:
JsonGeneratorFactory factory = Json.createGeneratorFactory();
JsonGenerator generator1 = factory.createGenerator(...);
JsonGenerator generator2 = factory.createGenerator(...);
All of the methods in this class are safe for use by multiple concurrent threads.
Method Summary | |
---|---|
JsonGenerator |
createGenerator(OutputStream out)
Creates a JSON generator which can be used to write JSON text to the specified byte stream. |
JsonGenerator |
createGenerator(OutputStream out,
String encoding)
Creates a JSON generator which can be used to write JSON text to the specified byte stream. |
JsonGenerator |
createGenerator(Writer writer)
Creates a JSON generator which can be used to write JSON text to the specified character stream. |
Method Detail |
---|
JsonGenerator createGenerator(Writer writer)
writer
- i/o writer to which JSON is writtenJsonGenerator createGenerator(OutputStream out)
out
- i/o stream to which JSON is writtenJsonGenerator createGenerator(OutputStream out, String encoding)
out
- i/o stream to which JSON is writtenencoding
- the name of character
encoding
of the stream.
JsonException
- if the named encoding is not supported.
The cause of the exception would be
UnsupportedEncodingException
Charset
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |