Interface JsonProvider
- All Superinterfaces:
OracleResourceProvider
A provider to create an OsonConverter for serialization
of Java objects to Oracle JSON (OSON) bytes and deserialization OSON bytes to
Java objects.
The
oracle.jdbc.provider.json
connection property identifies the name of a
JsonProvider implementation.
ServiceLoader locates implementations of
JsonProvider declared by a
META-INF/services/oracle.jdbc.spi.JsonProvider file in
the class path. Typically, this file is distributed within a jar file
that contains a JsonProvider implementation.
- Since:
- 23.5
-
Nested Class Summary
Nested classes/interfaces inherited from interface oracle.jdbc.spi.OracleResourceProvider
OracleResourceProvider.Parameter -
Method Summary
Modifier and TypeMethodDescriptiongetOsonConverter(Map<OracleResourceProvider.Parameter, CharSequence> parameterValues) Returns anOsonConverterto be used by Oracle JDBC for conversions of Oracle JSON (OSON) bytes into Java objects, and vice versa.Methods inherited from interface oracle.jdbc.spi.OracleResourceProvider
getName, getParameters
-
Method Details
-
getOsonConverter
Returns an
OsonConverterto be used by Oracle JDBC for conversions of Oracle JSON (OSON) bytes into Java objects, and vice versa. Oracle JDBC will invoke this method whenDriver.connect(String, Properties)is called to open a newConnection.The
parameterValuespassed to this method is aMapcomprised as follows:-
The key set is the same as, or a subset of, the
Parameterobjects returned by an invocation ofOracleResourceProvider.getParameters()on this provider. -
If no value is configured for a parameter, then the
Mapcontains the default value of thatParameter, if any. If the parameter has no default value, then the map does not contain an entry for thatParameter. -
The
Mapdoes not contain entries having null values.
parameterValuesMapmay contain aCharSequencehaving a security sensitive value. After this method returns, the caller may wipe the contents of theseCharSequencevalues from memory. Implementations of this method should not retain a reference to theseCharSequenceobjects.- Parameters:
parameterValues- Parameters configured by connection properties . Not null. May be empty.- Returns:
- An OSON converter. Not null.
- Throws:
IllegalArgumentException- If the value of a parameter can not be parsed or interpreted.IllegalStateException- If an implementation-specific failure prevents a resource from being provided.
-
The key set is the same as, or a subset of, the
-