public interface ValueConverter
JsonNode
and .
pre-processes JsonNode
s to objects easily convertible to LSPS
objects.Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.databind.JsonNode |
toNode(Object object,
com.whitestein.lsps.json.impl.WriteContext context,
boolean useExternalRef)
Converts an LSPS object to a
JsonNode . |
Object |
toObject(com.fasterxml.jackson.databind.JsonNode node,
com.whitestein.lsps.json.impl.ParseContext context)
Creates an object from
JsonNode . |
com.fasterxml.jackson.databind.JsonNode toNode(Object object, com.whitestein.lsps.json.impl.WriteContext context, boolean useExternalRef) throws JsonProcessingException
JsonNode
.object
- the object that should be written in the JSON stringcontext
- the writing contextJsonProcessingException
- if the object cannot be converted to the
JsonNode
.Object toObject(com.fasterxml.jackson.databind.JsonNode node, com.whitestein.lsps.json.impl.ParseContext context) throws JsonProcessingException
Creates an object from JsonNode
. It does not create LSPS objects
directly. The returned object can be java.util.List
,
a java.util.Set
, java.util.Map
, RecordData
or
Reference
. The returned object which can represent a complex
data structure has to be processed further prior to converting it to
LSPS objects. If this node
is a root node of the JSON document
then after this method is returned it is necessary to call
ParseContext.resolveReferences(Object)
to resolve all found
references. Once all the references are resolved the returned object can
be easily converted to LSPS object following this mappings:
Object | LSPS |
---|---|
RecordData | RecordHolder |
Set | SetHolder |
List | ListHolder |
Map | MapHolder |
simple types | simple types |
node
- the JSON nodecontext
- the parsing contextJsonProcessingException
- if the JsonNode
cannot be
converted to a LSPS object.Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.