public interface JsonGeneratorFactory
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.
Modifier and Type | Method and Description |
---|---|
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,
Charset charset)
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.
|
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, Charset charset)
out
- i/o stream to which JSON is writtencharset
- a charset
Comments to : [email protected]
Copyright © 2012 Oracle and/or its affiliates. All rights reserved.