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 JacksonJsonDataFormat
protected final com.fasterxml.jackson.databind.JsonNode
-
Constructor Summary
ConstructorsConstructorDescriptionJacksonJsonNode
(com.fasterxml.jackson.databind.JsonNode jsonNode, JacksonJsonDataFormat dataFormat) -
Method Summary
Modifier and TypeMethodDescriptionboolean
deleteProp
(String name) deleteProp
(List<String> names) elements()
protected Integer
getCorrectIndex
(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.JsonNodeType
boolean
insertAfter
(Object searchObject, Object insertObject) insertBefore
(Object searchObject, Object insertObject) isArray()
isNull()
isNumber()
boolean
isObject()
isString()
isValue()
lastIndexOf
(Object searchObject) protected int
lookupArray
(com.fasterxml.jackson.databind.JsonNode searchNode, int direction) <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.<C> C
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> C
Maps 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.JsonNode
unwrap()
value()
void
writeToWriter
(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:
getDataFormatName
in classSpin<SpinJsonNode>
-
unwrap
public com.fasterxml.jackson.databind.JsonNode unwrap()- Specified by:
unwrap
in classSpin<SpinJsonNode>
-
toString
- Specified by:
toString
in classSpin<SpinJsonNode>
-
writeToWriter
- Specified by:
writeToWriter
in 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:
Integer
new index
-
lookupArray
protected int lookupArray(com.fasterxml.jackson.databind.JsonNode searchNode, int direction) -
indexOf
- Specified by:
indexOf
in classSpinJsonNode
-
lastIndexOf
- Specified by:
lastIndexOf
in classSpinJsonNode
-
contains
- Specified by:
contains
in classSpinJsonNode
-
isObject
public boolean isObject()- Specified by:
isObject
in classSpinJsonNode
-
hasProp
- Specified by:
hasProp
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
propList
-
prop
- Specified by:
prop
in classSpinJsonNode
-
prop
- Specified by:
prop
in classSpinJsonNode
-
deleteProp
- Specified by:
deleteProp
in classSpinJsonNode
-
deleteProp
- Specified by:
deleteProp
in classSpinJsonNode
-
append
- Specified by:
append
in classSpinJsonNode
-
insertAt
- Specified by:
insertAt
in classSpinJsonNode
-
insertBefore
- Specified by:
insertBefore
in classSpinJsonNode
-
insertAfter
- Specified by:
insertAfter
in classSpinJsonNode
-
remove
- Specified by:
remove
in classSpinJsonNode
-
removeLast
- Specified by:
removeLast
in classSpinJsonNode
-
removeAt
- Specified by:
removeAt
in classSpinJsonNode
-
isBoolean
- Specified by:
isBoolean
in classSpinJsonNode
-
boolValue
- Specified by:
boolValue
in classSpinJsonNode
-
isNumber
- Specified by:
isNumber
in classSpinJsonNode
-
numberValue
- Specified by:
numberValue
in classSpinJsonNode
-
isString
- Specified by:
isString
in classSpinJsonNode
-
stringValue
- Specified by:
stringValue
in classSpinJsonNode
-
isNull
- Specified by:
isNull
in classSpinJsonNode
-
isValue
- Specified by:
isValue
in classSpinJsonNode
-
value
- Specified by:
value
in classSpinJsonNode
-
isArray
- Specified by:
isArray
in classSpinJsonNode
-
elements
- Specified by:
elements
in classSpinJsonNode
-
fieldNames
- Specified by:
fieldNames
in classSpinJsonNode
-
getNodeType
public com.fasterxml.jackson.databind.node.JsonNodeType getNodeType() -
jsonPath
- Specified by:
jsonPath
in 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:
mapTo
in 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:
mapTo
in 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
-