public class JacksonJsonNode extends SpinJsonNode
| Modifier and Type | Field and Description |
|---|---|
protected JacksonJsonDataFormat |
dataFormat |
protected com.fasterxml.jackson.databind.JsonNode |
jsonNode |
| Constructor and Description |
|---|
JacksonJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode,
JacksonJsonDataFormat dataFormat) |
| Modifier and Type | Method and Description |
|---|---|
SpinJsonNode |
append(Object property)
Appends a object to the end of the current array node
|
Boolean |
boolValue()
Get this node as a boolean value.
|
SpinJsonNode |
deleteProp(List<String> names)
Removes a number of properties by a given list of names.
|
SpinJsonNode |
deleteProp(String name)
Remove a property of the given node by name.
|
SpinList<SpinJsonNode> |
elements()
Get this node as list.
|
List<String> |
fieldNames()
Get the field names of this node (i.e.
|
protected Integer |
getCorrectIndex(Integer index)
fetch correct array index if index is less than 0
ArrayNode will convert all negative integers into 0...
|
String |
getDataFormatName()
Provides the name of the dataformat used by this spin.
|
com.fasterxml.jackson.databind.node.JsonNodeType |
getNodeType() |
boolean |
hasProp(String name)
Check if this node has a property with the given name.
|
Integer |
indexOf(Object searchObject)
Fetches the first index of the searched object in an array.
|
SpinJsonNode |
insertAfter(Object searchObject,
Object insertObject)
Inserts an object AFTER an specific object in an array
|
SpinJsonNode |
insertAt(int index,
Object property)
Appends an object at a specific point in an array
|
SpinJsonNode |
insertBefore(Object searchObject,
Object insertObject)
Inserts an object BEFORE an specific object in an array
|
Boolean |
isArray()
Check if this node is a array value.
|
Boolean |
isBoolean()
Check if this node is a boolean value.
|
Boolean |
isNull()
Check if this node represents a null value.
|
Boolean |
isNumber()
Check if this node is a number value.
|
boolean |
isObject()
Check if this node is an object node.
|
Boolean |
isString()
Check if this node is a string value.
|
Boolean |
isValue()
Check if this node is a value.
|
SpinJsonPathQuery |
jsonPath(String expression)
Creates a JsonPath query on this element.
|
Integer |
lastIndexOf(Object searchObject)
Fetches the last index of the searched object in an array.
|
<C> C |
mapTo(Class<C> 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 |
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 |
mapTo(String type)
Maps the json represented by this object to a java object of the given type.
|
Number |
numberValue()
Get this node as a number value.
|
SpinJsonNode |
prop(String name)
Get the property of this node with the given name.
|
SpinJsonNode |
prop(String name,
boolean newProperty)
Set a new boolean property in this node.
|
SpinJsonNode |
prop(String name,
Boolean newProperty)
Set a new Boolean property in this node.
|
SpinJsonNode |
prop(String name,
float newProperty)
Set a new float property in this node.
|
SpinJsonNode |
prop(String name,
int newProperty)
Set a new int property in this node.
|
SpinJsonNode |
prop(String name,
List<Object> newProperty)
Set a new List property in this node.
|
SpinJsonNode |
prop(String name,
long newProperty)
Set a new long property in this node.
|
SpinJsonNode |
prop(String name,
Map<String,Object> newProperty)
Set a new Map property in this node.
|
SpinJsonNode |
prop(String name,
Number newProperty)
Set a new Number property in this node.
|
SpinJsonNode |
prop(String name,
SpinJsonNode newProperty)
Set a new SpinJsonNode Object property in this node.
|
SpinJsonNode |
prop(String name,
String newProperty)
Set a new String property in this node.
|
SpinJsonNode |
remove(Object property)
Removes the first appearance of an object from the current array
|
SpinJsonNode |
removeAt(int index)
removes an object at the specific index of the current array
|
SpinJsonNode |
removeLast(Object property)
Removes the last appearance of an object from the current array
|
String |
stringValue()
Get this node as a number value.
|
String |
toString()
Returns the wrapped object as string representation.
|
com.fasterxml.jackson.databind.JsonNode |
unwrap()
Return the wrapped object.
|
Object |
value()
Gets the actual value of the node, in case it is a Boolean/String/Number/Null node.
|
void |
writeToWriter(Writer writer)
Writes the wrapped object to a existing writer.
|
protected final com.fasterxml.jackson.databind.JsonNode jsonNode
protected final JacksonJsonDataFormat dataFormat
public JacksonJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode,
JacksonJsonDataFormat dataFormat)
public String getDataFormatName()
SpingetDataFormatName in class Spin<SpinJsonNode>public com.fasterxml.jackson.databind.JsonNode unwrap()
Spinunwrap in class Spin<SpinJsonNode>public String toString()
SpintoString in class Spin<SpinJsonNode>public void writeToWriter(Writer writer)
SpinwriteToWriter in class Spin<SpinJsonNode>writer - the writer to write toprotected Integer getCorrectIndex(Integer index)
index - wanted indexInteger new indexpublic Integer indexOf(Object searchObject)
SpinJsonNodeindexOf in class SpinJsonNodesearchObject - Object for which the index should be searched.Integer index of searchObject.public Integer lastIndexOf(Object searchObject)
SpinJsonNodelastIndexOf in class SpinJsonNodesearchObject - Object for which the index should be searched.Integer index of searchObject or -1 if object not found.public boolean isObject()
SpinJsonNodeisObject in class SpinJsonNodepublic boolean hasProp(String name)
SpinJsonNodehasProp in class SpinJsonNodename - the name of the propertypublic SpinJsonNode prop(String name)
SpinJsonNodeprop in class SpinJsonNodename - the name of the propertySpinJsonNode representation of the propertypublic SpinJsonNode prop(String name, String newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new String propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, Number newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new Number propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, int newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new int propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, float newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new float propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, long newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new long propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, boolean newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new boolean propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, Boolean newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new Boolean propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, List<Object> newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new List propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, Map<String,Object> newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new Map propertySpinJsonNode representation of the current nodepublic SpinJsonNode prop(String name, SpinJsonNode newProperty)
SpinJsonNodeprop in class SpinJsonNodename - the name of the new propertynewProperty - the new SpinJsonNode Object propertySpinJsonNode representation of the current nodepublic SpinJsonNode deleteProp(String name)
SpinJsonNodedeleteProp in class SpinJsonNodename - name of the propertySpinJsonNode representation of the current nodepublic SpinJsonNode deleteProp(List<String> names)
SpinJsonNodedeleteProp in class SpinJsonNodenames - list of namesSpinJsonNode representation of the current nodepublic SpinJsonNode append(Object property)
SpinJsonNodeappend in class SpinJsonNodeproperty - property which should be appendSpinJsonNode representation of the current nodepublic SpinJsonNode insertAt(int index, Object property)
SpinJsonNodeinsertAt in class SpinJsonNodeindex - Index in current node where the new property should be appended.property - Object which should be appended.SpinJsonNode representation of the current node.public SpinJsonNode insertBefore(Object searchObject, Object insertObject)
SpinJsonNodeinsertBefore in class SpinJsonNodesearchObject - Object which is searchedinsertObject - Object which will be insertedSpinJsonNode representation of the current nodepublic SpinJsonNode insertAfter(Object searchObject, Object insertObject)
SpinJsonNodeinsertAfter in class SpinJsonNodesearchObject - Object which is searchedinsertObject - Object which will be insertedSpinJsonNode representation of the current nodepublic SpinJsonNode remove(Object property)
SpinJsonNoderemove in class SpinJsonNodeproperty - object which should be deletedSpinJsonNode representation of the current nodepublic SpinJsonNode removeLast(Object property)
SpinJsonNoderemoveLast in class SpinJsonNodeproperty - object which should be deletedSpinJsonNode representation of the current nodepublic SpinJsonNode removeAt(int index)
SpinJsonNoderemoveAt in class SpinJsonNodeindex - Index of the arraySpinJsonNode representation of the current nodepublic Boolean isBoolean()
SpinJsonNodeisBoolean in class SpinJsonNodepublic Boolean boolValue()
SpinJsonNodeboolValue in class SpinJsonNodepublic Boolean isNumber()
SpinJsonNodeisNumber in class SpinJsonNodepublic Number numberValue()
SpinJsonNodenumberValue in class SpinJsonNodepublic Boolean isString()
SpinJsonNodeisString in class SpinJsonNodepublic String stringValue()
SpinJsonNodestringValue in class SpinJsonNodepublic Boolean isNull()
SpinJsonNodeisNull in class SpinJsonNodepublic Boolean isValue()
SpinJsonNodeisValue in class SpinJsonNodepublic Object value()
SpinJsonNodevalue in class SpinJsonNodepublic Boolean isArray()
SpinJsonNodeisArray in class SpinJsonNodepublic SpinList<SpinJsonNode> elements()
SpinJsonNodeelements in class SpinJsonNodepublic List<String> fieldNames()
SpinJsonNodefieldNames in class SpinJsonNodepublic com.fasterxml.jackson.databind.node.JsonNodeType getNodeType()
public SpinJsonPathQuery jsonPath(String expression)
SpinJsonNodejsonPath in class SpinJsonNodeexpression - the JsonPath expressionpublic <C> C mapTo(Class<C> type)
mapTo in class Spin<SpinJsonNode>type - the java class to map toSpinJsonException - if the json representation cannot be mapped to the specified typepublic <C> C mapTo(String type)
ResolvedType.toCanonical()).mapTo in class Spin<SpinJsonNode>type - the class name to map toSpinJsonException - if the json representation cannot be mapped to the specified typeSpinJsonDataFormatException - if the parameter does not match a valid typepublic <C> C mapTo(com.fasterxml.jackson.databind.JavaType type)
SpinJsonException - if the json representation cannot be mapped to the specified typeCopyright © 2014–2020 Camunda Services GmbH. All rights reserved.