public abstract class JsonProvider extends Object
ServiceLoader
Modifier | Constructor and Description |
---|---|
protected |
JsonProvider() |
Modifier and Type | Method and Description |
---|---|
abstract JsonGenerator |
createGenerator(OutputStream out)
Creates a JSON generator which can be used to write JSON text to the
specified byte stream.
|
abstract JsonGenerator |
createGenerator(Writer writer)
Creates a JSON generator which can be used to write JSON text to the
specified character stream.
|
abstract JsonGeneratorFactory |
createGeneratorFactory()
Creates a generator factory which can be used to create
JsonGenerator . |
abstract JsonGeneratorFactory |
createGeneratorFactory(JsonConfiguration config)
Creates a generator factory which can be used to create
JsonGenerator . |
abstract JsonParser |
createParser(InputStream in)
Creates a JSON parser from the specified byte stream.
|
abstract JsonParser |
createParser(Reader reader)
Creates a JSON parser from the specified character stream
|
abstract JsonParserFactory |
createParserFactory()
Creates a parser factory which can be used to create
JsonParser . |
abstract JsonParserFactory |
createParserFactory(JsonConfiguration config)
Creates a parser factory which can be used to create
JsonParser . |
static JsonProvider |
provider()
Creates a JSON provider object.
|
public static JsonProvider provider()
ServiceLoader.load(Class)
method. If there is no available
service provider is found, then the default service provider
is returned.ServiceLoader
public abstract JsonParser createParser(Reader reader)
reader
- i/o reader from which JSON is to be readpublic abstract JsonParser createParser(InputStream in)
in
- i/o stream from which JSON is to be readJsonException
- if encoding cannot be determined
or i/o error (IOException would be cause of JsonException)public abstract JsonParserFactory createParserFactory()
JsonParser
.public abstract JsonParserFactory createParserFactory(JsonConfiguration config)
JsonParser
.
The created parser factory is configured with the specified
configurationconfig
- configuration of the parser factorypublic abstract JsonGenerator createGenerator(Writer writer)
writer
- a i/o writer to which JSON is writtenpublic abstract JsonGenerator createGenerator(OutputStream out)
out
- i/o stream to which JSON is writtenpublic abstract JsonGeneratorFactory createGeneratorFactory()
JsonGenerator
.public abstract JsonGeneratorFactory createGeneratorFactory(JsonConfiguration config)
JsonGenerator
.
The created generator factory is configured with the specified
configuration.config
- configuration of the generator factory
Comments to : [email protected]
Copyright © 2012 Oracle and/or its affiliates. All rights reserved.