Package org.glassfish.json
Class JsonProviderImpl
- java.lang.Object
-
- javax.json.spi.JsonProvider
-
- org.glassfish.json.JsonProviderImpl
-
public class JsonProviderImpl extends JsonProvider
- Author:
- Jitendra Kotamraju
-
-
Constructor Summary
Constructors Constructor Description JsonProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonArrayBuilder
createArrayBuilder()
Creates a JSON array builderJsonBuilderFactory
createBuilderFactory(java.util.Map<java.lang.String,?> config)
Creates a builder factory for creatingJsonArrayBuilder
andJsonObjectBuilder
objects.JsonGenerator
createGenerator(java.io.OutputStream out)
Creates a JSON generator for writing JSON text to a byte stream.JsonGenerator
createGenerator(java.io.Writer writer)
Creates a JSON generator for writing JSON text to a character stream.JsonGeneratorFactory
createGeneratorFactory(java.util.Map<java.lang.String,?> config)
Creates a generator factory for creatingJsonGenerator
instances.JsonObjectBuilder
createObjectBuilder()
Creates a JSON object builderJsonParser
createParser(java.io.InputStream in)
Creates a JSON parser from the specified byte stream.JsonParser
createParser(java.io.Reader reader)
Creates a JSON parser from a character stream.JsonParserFactory
createParserFactory(java.util.Map<java.lang.String,?> config)
Creates a parser factory for creatingJsonParser
instances.JsonReader
createReader(java.io.InputStream in)
Creates a JSON reader from a byte stream.JsonReader
createReader(java.io.Reader reader)
Creates a JSON reader from a character stream.JsonReaderFactory
createReaderFactory(java.util.Map<java.lang.String,?> config)
Creates a reader factory for creatingJsonReader
objects.JsonWriter
createWriter(java.io.OutputStream out)
JsonWriter
createWriter(java.io.Writer writer)
JsonWriterFactory
createWriterFactory(java.util.Map<java.lang.String,?> config)
Creates a writer factory for creatingJsonWriter
objects.-
Methods inherited from class javax.json.spi.JsonProvider
provider
-
-
-
-
Method Detail
-
createGenerator
public JsonGenerator createGenerator(java.io.Writer writer)
Description copied from class:JsonProvider
Creates a JSON generator for writing JSON text to a character stream.- Specified by:
createGenerator
in classJsonProvider
- Parameters:
writer
- a i/o writer to which JSON is written- Returns:
- a JSON generator
-
createGenerator
public JsonGenerator createGenerator(java.io.OutputStream out)
Description copied from class:JsonProvider
Creates a JSON generator for writing JSON text to a byte stream.- Specified by:
createGenerator
in classJsonProvider
- Parameters:
out
- i/o stream to which JSON is written- Returns:
- a JSON generator
-
createParser
public JsonParser createParser(java.io.Reader reader)
Description copied from class:JsonProvider
Creates a JSON parser from a character stream.- Specified by:
createParser
in classJsonProvider
- Parameters:
reader
- i/o reader from which JSON is to be read- Returns:
- a JSON parser
-
createParser
public JsonParser createParser(java.io.InputStream in)
Description copied from class:JsonProvider
Creates a JSON parser from the specified byte stream. The character encoding of the stream is determined as defined in RFC 4627 .- Specified by:
createParser
in classJsonProvider
- Parameters:
in
- i/o stream from which JSON is to be read- Returns:
- a JSON parser
-
createParserFactory
public JsonParserFactory createParserFactory(java.util.Map<java.lang.String,?> config)
Description copied from class:JsonProvider
Creates a parser factory for creatingJsonParser
instances. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.- Specified by:
createParserFactory
in classJsonProvider
- Parameters:
config
- a map of provider specific properties to configure the JSON parsers. The map may be empty or null- Returns:
- a JSON parser factory
-
createGeneratorFactory
public JsonGeneratorFactory createGeneratorFactory(java.util.Map<java.lang.String,?> config)
Description copied from class:JsonProvider
Creates a generator factory for creatingJsonGenerator
instances. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.- Specified by:
createGeneratorFactory
in classJsonProvider
- Parameters:
config
- a map of provider specific properties to configure the JSON generators. The map may be empty or null- Returns:
- a JSON generator factory
-
createReader
public JsonReader createReader(java.io.Reader reader)
Description copied from class:JsonProvider
Creates a JSON reader from a character stream.- Specified by:
createReader
in classJsonProvider
- Parameters:
reader
- a reader from which JSON is to be read- Returns:
- a JSON reader
-
createReader
public JsonReader createReader(java.io.InputStream in)
Description copied from class:JsonProvider
Creates a JSON reader from a byte stream. The character encoding of the stream is determined as described in RFC 4627.- Specified by:
createReader
in classJsonProvider
- Parameters:
in
- a byte stream from which JSON is to be read- Returns:
- a JSON reader
-
createWriter
public JsonWriter createWriter(java.io.Writer writer)
Description copied from class:JsonProvider
- Specified by:
createWriter
in classJsonProvider
- Parameters:
writer
- to which JSON object or array is written- Returns:
- a JSON writer
-
createWriter
public JsonWriter createWriter(java.io.OutputStream out)
Description copied from class:JsonProvider
Creates a JSON writer to write a JSONobject
orarray
structure to the specified byte stream. Characters written to the stream are encoded into bytes using UTF-8 encoding.- Specified by:
createWriter
in classJsonProvider
- Parameters:
out
- to which JSON object or array is written- Returns:
- a JSON writer
-
createWriterFactory
public JsonWriterFactory createWriterFactory(java.util.Map<java.lang.String,?> config)
Description copied from class:JsonProvider
Creates a writer factory for creatingJsonWriter
objects. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.- Specified by:
createWriterFactory
in classJsonProvider
- Parameters:
config
- a map of provider specific properties to configure the JSON writers. The map may be empty or null- Returns:
- a JSON writer factory
-
createReaderFactory
public JsonReaderFactory createReaderFactory(java.util.Map<java.lang.String,?> config)
Description copied from class:JsonProvider
Creates a reader factory for creatingJsonReader
objects. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.- Specified by:
createReaderFactory
in classJsonProvider
- Parameters:
config
- a map of provider specific properties to configure the JSON readers. The map may be empty or null- Returns:
- a JSON reader factory
-
createObjectBuilder
public JsonObjectBuilder createObjectBuilder()
Description copied from class:JsonProvider
Creates a JSON object builder- Specified by:
createObjectBuilder
in classJsonProvider
- Returns:
- a JSON object builder
-
createArrayBuilder
public JsonArrayBuilder createArrayBuilder()
Description copied from class:JsonProvider
Creates a JSON array builder- Specified by:
createArrayBuilder
in classJsonProvider
- Returns:
- a JSON array builder
-
createBuilderFactory
public JsonBuilderFactory createBuilderFactory(java.util.Map<java.lang.String,?> config)
Description copied from class:JsonProvider
Creates a builder factory for creatingJsonArrayBuilder
andJsonObjectBuilder
objects. The factory is configured with the specified map of provider specific configuration properties. Provider implementations should ignore any unsupported configuration properties specified in the map.- Specified by:
createBuilderFactory
in classJsonProvider
- Parameters:
config
- a map of provider specific properties to configure the JSON builders. The map may be empty or null- Returns:
- a JSON builder factory
-
-