public class JsonGenericParser extends Object
Constructor and Description |
---|
JsonGenericParser() |
Modifier and Type | Method and Description |
---|---|
Object |
parse(String json,
ExecutionContext ctx)
Deprecated.
|
Object |
parse(String json,
ExecutionContext ctx,
boolean doInsert,
boolean doUpdate) |
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 . |
@Deprecated public Object parse(String json, ExecutionContext ctx)
json
- The JSON string.namespace
- The name space in which the objects should be created.langModule
- the language module of the process modelpublic Object parse(String json, ExecutionContext ctx, boolean doInsert, boolean doUpdate)
public Object toObject(com.fasterxml.jackson.databind.JsonNode node, com.whitestein.lsps.json.impl.ParseContext context) throws JsonProcessingException
ValueConverter
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.public com.fasterxml.jackson.databind.JsonNode toNode(Object object, com.whitestein.lsps.json.impl.WriteContext context, boolean useExternalRef) throws JsonProcessingException
ValueConverter
JsonNode
.object
- the object that should be written in the JSON stringcontext
- the writing contextJsonProcessingException
- if the object cannot be converted to the
JsonNode
.Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.