public interface JsonDeserializer
Implementations of this service are expected to be provided by additional
integration modules, such as domino-jnx-jsonp
.
Modifier and Type | Method and Description |
---|---|
JsonDeserializer |
booleanValues(Object trueValue,
Object falseValue)
Configures the values to be stored in the target document when the deserializer
encounters JSON boolean values.
|
static JsonDeserializer |
createDeserializer()
Constructs a new deserializer using the first available JSON service.
|
JsonDeserializer |
dateTimeItems(Collection<String> dateTimeItems)
Configures the deserializer to expect the named items to contain date/time values.
|
default Document |
fromJson(Object json)
Deserializes the provided implementation-specific JSON object into a document.
|
Document |
fromJson(String json)
Deserializes the provided JSON object string into a document.
|
JsonDeserializer |
removeMissingItems(boolean removeMissingItems)
Configures whether items in a document provided via
target(Document)
that do not exist in the incoming JSON should be removed. |
JsonDeserializer |
target(Database database)
Sets the deserialization target to be a new document in the target database.
|
JsonDeserializer |
target(Document document)
Sets the deserialization target to be an existing document in the target database.
|
static JsonDeserializer createDeserializer()
JsonSerializer
implementationIllegalStateException
- if there is no registered deserializer implementationJsonDeserializer target(Database database)
Documents imported this way will be returned unsaved in memory.
database
- the database to import intoJsonDeserializer target(Document document)
Documents imported this way will be modified in-place in memory but not saved.
document
- the document to write toJsonDeserializer dateTimeItems(Collection<String> dateTimeItems)
This will cause such values to be parsed as date/times and ranges compatible with
the output of JsonSerializer
and to throw an exception when the value in the
incoming JSON object is not either a valid value or empty.
dateTimeItems
- the names of items expected to contain date/time valuesJsonDeserializer removeMissingItems(boolean removeMissingItems)
target(Document)
that do not exist in the incoming JSON should be removed.
The default behavior is to only update items that are represented as properties in the incoming JSON.
The "Form"
item and items beginning with "$"
will never be removed
in this way.
removeMissingItems
- whether items not present in JSON should be removedJsonDeserializer booleanValues(Object trueValue, Object falseValue)
trueValue
- the value used when converting true
falseValue
- the value used when converting false
default Document fromJson(Object json)
json
- the implementation-specific native JSON object to deserializeRuntimeException
- an implementation-specific exception when the JSON is unprocessable
as configuredDocument fromJson(String json)
json
- the JSON string to deserializeRuntimeException
- an implementation-specific exception when the JSON is unprocessable
as configuredCopyright © 2019–2021 HCL. All rights reserved.