public interface OracleDocumentFactory
OracleDocument
objects.Modifier and Type | Method and Description |
---|---|
OracleDocument |
createDocumentFrom(java.lang.Object content)
Creates a new document with the provided key and provided
JSON
content object. |
OracleDocument |
createDocumentFrom(java.lang.String key,
java.lang.Object content)
Creates a new document with the provided key and JSON
content
object. |
OracleDocument |
createDocumentFromByteArray(byte[] content)
Creates a new document with the provided
byte[] JSON content. |
OracleDocument |
createDocumentFromByteArray(java.lang.String key,
byte[] content)
Creates a new document with the provided key and
byte[] JSON content. |
OracleDocument |
createDocumentFromByteArray(java.lang.String key,
byte[] content,
java.lang.String mediaType)
Creates a new document with the provided key,
byte[]
content, and content type. |
OracleDocument |
createDocumentFromString(java.lang.String content)
Creates a new document with the provided
String JSON content. |
OracleDocument |
createDocumentFromString(java.lang.String key,
java.lang.String content)
Creates a new document with the provided key and
String JSON content. |
OracleDocument |
createDocumentFromString(java.lang.String key,
java.lang.String content,
java.lang.String mediaType)
Creates a new document with the provided key,
String
content, and media type. |
OracleDocument createDocumentFromString(java.lang.String content) throws OracleException
String
JSON content.
This method is equivalent to invoking
createDocumentFromString(null, content, null)
content
- document content. Can be null
OracleDocument
, with
media type "application/json"
OracleException
- if the document cannot be createdcreateDocumentFromString(String, String, String)
,
createDocumentFromString(String, String)
OracleDocument createDocumentFromString(java.lang.String key, java.lang.String content) throws OracleException
String
JSON content.
This method is equivalent to invoking
createDocumentFromString(key, content, null)
key
- document key. Can be null
content
- document content. Can be null
OracleDocument
, with
media type "application/json"
OracleException
- if the document cannot be createdcreateDocumentFromString(String, String, String)
,
createDocumentFromString(String)
OracleDocument createDocumentFromString(java.lang.String key, java.lang.String content, java.lang.String mediaType) throws OracleException
String
content, and media type.
If the media type is "application/json"
or null
,
the provided content
must be JSON, as defined in RFC 4627.
key
- document key. Can be null
content
- document content. Can be null
mediaType
- document media type. Can be null
,
in which case the media type defaults to
"application/json"
. An implementation
might not support any particular media typeOracleDocument
OracleException
- if the document cannot be createdOracleDocument createDocumentFrom(java.lang.Object content) throws OracleException
content
object.
This method is equivalent to invoking
createDocumentFrom(null, content)
content
- document content. Must not be null
OracleDocument
, with
media type "application/json"
OracleException
- if the document cannot be created from the
specified valuecreateDocumentFrom(String, Object)
OracleDocument createDocumentFrom(java.lang.String key, java.lang.Object content) throws OracleException
content
object. The content object must be an instance
of one of the following types:
Class | Description |
---|---|
javax.json.JsonValue oracle.sql.json.OracleJsonValue
|
A instance of JsonValue or OracleJsonValue . This includes derivations
such as JsonObject and JsonArray .
For example:
|
javax.json.stream.JsonParser oracle.sql.json.OracleJsonParser
|
A JSON event stream. |
java.lang.String java.lang.CharSequence java.io.Reader |
A JSON text value. |
key
- document key. Can be null
content
- document content. Must not be null
OracleDocument
, with
media type "application/json"
OracleException
- if the document cannot be created from the
specified value.OracleDocument createDocumentFromByteArray(byte[] content) throws OracleException
byte[]
JSON content.
This method is equivalent to invoking
createDocumentFromByteArray(null, content, null)
content
- document content. Can be null
OracleDocument
, with
media type "application/json"
OracleException
- if the document cannot be createdcreateDocumentFromByteArray(String, byte[], String)
,
createDocumentFromByteArray(String, byte[])
OracleDocument createDocumentFromByteArray(java.lang.String key, byte[] content) throws OracleException
byte[]
JSON content.
This method is equivalent to invoking
createDocumentFromByteArray(key, content, null)
key
- document key. Can be null
content
- document content. Can be null
OracleDocument
, with
media type "application/json"
OracleException
- if the document cannot be createdcreateDocumentFromByteArray(String, byte[], String)
,
createDocumentFromByteArray(byte[])
OracleDocument createDocumentFromByteArray(java.lang.String key, byte[] content, java.lang.String mediaType) throws OracleException
byte[]
content, and content type.
If the media type is "application/json"
or null
,
the provided content
must be JSON, as defined in RFC 4627.
The supported encodings are UTF-8, and UTF16 (BE and LE).
key
- document key. Can be null
content
- document content. Can be null
mediaType
- document media type. Can be null
,
in which case the media type defaults to
"application/json"
. An implementation
might not support any particular media typeOracleDocument
OracleException
- if the document cannot be created