Class JacksonJsonNode
java.lang.Object
org.camunda.spin.Spin<SpinJsonNode>
org.camunda.spin.json.SpinJsonNode
org.camunda.spin.impl.json.jackson.JacksonJsonNode
Wrapper for a Jackson Json Tree Node.
- Author:
- Thorben Lindhauer, Stefan Hentschel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JacksonJsonDataFormatprotected final com.fasterxml.jackson.databind.JsonNode -
Constructor Summary
ConstructorsConstructorDescriptionJacksonJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, JacksonJsonDataFormat dataFormat) -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteProp(String name) deleteProp(List<String> names) elements()protected IntegergetCorrectIndex(Integer index) fetch correct array index if index is less than 0 ArrayNode will convert all negative integers into 0...com.fasterxml.jackson.databind.node.JsonNodeTypebooleaninsertAfter(Object searchObject, Object insertObject) insertBefore(Object searchObject, Object insertObject) isArray()isNull()isNumber()booleanisObject()isString()isValue()lastIndexOf(Object searchObject) protected intlookupArray(com.fasterxml.jackson.databind.JsonNode searchNode, int direction) <C> CmapTo(com.fasterxml.jackson.databind.JavaType type) Maps the json represented by this object to a java object of the given type.
Note: the desired target type is not validated and needs to be trusted.<C> CMaps the json represented by this object to a java object of the given type.
Note: the desired target type is not validated and needs to be trusted.<C> CMaps the json represented by this object to a java object of the given type.prop(String name, SpinJsonNode newProperty) removeAt(int index) removeLast(Object property) toString()com.fasterxml.jackson.databind.JsonNodeunwrap()value()voidwriteToWriter(Writer writer)
-
Field Details
-
jsonNode
protected final com.fasterxml.jackson.databind.JsonNode jsonNode -
dataFormat
-
-
Constructor Details
-
JacksonJsonNode
public JacksonJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, JacksonJsonDataFormat dataFormat)
-
-
Method Details
-
getDataFormatName
- Specified by:
getDataFormatNamein classSpin<SpinJsonNode>
-
unwrap
public com.fasterxml.jackson.databind.JsonNode unwrap()- Specified by:
unwrapin classSpin<SpinJsonNode>
-
toString
- Specified by:
toStringin classSpin<SpinJsonNode>
-
writeToWriter
- Specified by:
writeToWriterin classSpin<SpinJsonNode>
-
getCorrectIndex
fetch correct array index if index is less than 0 ArrayNode will convert all negative integers into 0...- Parameters:
index- wanted index- Returns:
Integernew index
-
lookupArray
protected int lookupArray(com.fasterxml.jackson.databind.JsonNode searchNode, int direction) -
indexOf
- Specified by:
indexOfin classSpinJsonNode
-
lastIndexOf
- Specified by:
lastIndexOfin classSpinJsonNode
-
contains
- Specified by:
containsin classSpinJsonNode
-
isObject
public boolean isObject()- Specified by:
isObjectin classSpinJsonNode
-
hasProp
- Specified by:
hasPropin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
propList
-
prop
- Specified by:
propin classSpinJsonNode
-
prop
- Specified by:
propin classSpinJsonNode
-
deleteProp
- Specified by:
deletePropin classSpinJsonNode
-
deleteProp
- Specified by:
deletePropin classSpinJsonNode
-
append
- Specified by:
appendin classSpinJsonNode
-
insertAt
- Specified by:
insertAtin classSpinJsonNode
-
insertBefore
- Specified by:
insertBeforein classSpinJsonNode
-
insertAfter
- Specified by:
insertAfterin classSpinJsonNode
-
remove
- Specified by:
removein classSpinJsonNode
-
removeLast
- Specified by:
removeLastin classSpinJsonNode
-
removeAt
- Specified by:
removeAtin classSpinJsonNode
-
isBoolean
- Specified by:
isBooleanin classSpinJsonNode
-
boolValue
- Specified by:
boolValuein classSpinJsonNode
-
isNumber
- Specified by:
isNumberin classSpinJsonNode
-
numberValue
- Specified by:
numberValuein classSpinJsonNode
-
isString
- Specified by:
isStringin classSpinJsonNode
-
stringValue
- Specified by:
stringValuein classSpinJsonNode
-
isNull
- Specified by:
isNullin classSpinJsonNode
-
isValue
- Specified by:
isValuein classSpinJsonNode
-
value
- Specified by:
valuein classSpinJsonNode
-
isArray
- Specified by:
isArrayin classSpinJsonNode
-
elements
- Specified by:
elementsin classSpinJsonNode
-
fieldNames
- Specified by:
fieldNamesin classSpinJsonNode
-
getNodeType
public com.fasterxml.jackson.databind.node.JsonNodeType getNodeType() -
jsonPath
- Specified by:
jsonPathin classSpinJsonNode
-
mapTo
Maps the json represented by this object to a java object of the given type.
Note: the desired target type is not validated and needs to be trusted.- Specified by:
mapToin classSpin<SpinJsonNode>- Throws:
SpinJsonException- if the json representation cannot be mapped to the specified type
-
mapTo
Maps the json represented by this object to a java object of the given type. Argument is to be supplied in Jackson's canonical type string format (seeResolvedType.toCanonical()).
Note: the desired target type is not validated and needs to be trusted.- Specified by:
mapToin classSpin<SpinJsonNode>- Throws:
SpinJsonException- if the json representation cannot be mapped to the specified typeSpinJsonDataFormatException- if the parameter does not match a valid type
-
mapTo
public <C> C mapTo(com.fasterxml.jackson.databind.JavaType type) Maps the json represented by this object to a java object of the given type.
Note: the desired target type is not validated and needs to be trusted.- Throws:
SpinJsonException- if the json representation cannot be mapped to the specified type
-