public abstract class SpinJsonNode extends Spin<SpinJsonNode>
Constructor and Description |
---|
SpinJsonNode() |
Modifier and Type | Method and Description |
---|---|
abstract SpinJsonNode |
append(Object property)
Appends a object to the end of the current array node
|
abstract Boolean |
boolValue()
Get this node as a boolean value.
|
abstract SpinJsonNode |
deleteProp(List<String> names)
Removes a number of properties by a given list of names.
|
abstract SpinJsonNode |
deleteProp(String name)
Remove a property of the given node by name.
|
abstract SpinList<SpinJsonNode> |
elements()
Get this node as list.
|
abstract List<String> |
fieldNames()
Get the field names of this node (i.e.
|
abstract boolean |
hasProp(String name)
Check if this node has a property with the given name.
|
abstract Integer |
indexOf(Object searchObject)
Fetches the first index of the searched object in an array.
|
abstract SpinJsonNode |
insertAfter(Object searchObject,
Object insertObject)
Inserts an object AFTER an specific object in an array
|
abstract SpinJsonNode |
insertAt(int index,
Object property)
Appends an object at a specific point in an array
|
abstract SpinJsonNode |
insertBefore(Object searchObject,
Object insertObject)
Inserts an object BEFORE an specific object in an array
|
abstract Boolean |
isArray()
Check if this node is a array value.
|
abstract Boolean |
isBoolean()
Check if this node is a boolean value.
|
abstract Boolean |
isNull()
Check if this node represents a null value.
|
abstract Boolean |
isNumber()
Check if this node is a number value.
|
abstract boolean |
isObject()
Check if this node is an object node.
|
abstract Boolean |
isString()
Check if this node is a string value.
|
abstract Boolean |
isValue()
Check if this node is a value.
|
abstract SpinJsonPathQuery |
jsonPath(String expression)
Creates a JsonPath query on this element.
|
abstract Integer |
lastIndexOf(Object searchObject)
Fetches the last index of the searched object in an array.
|
abstract Number |
numberValue()
Get this node as a number value.
|
abstract SpinJsonNode |
prop(String name)
Get the property of this node with the given name.
|
abstract SpinJsonNode |
prop(String name,
boolean newProperty)
Set a new boolean property in this node.
|
abstract SpinJsonNode |
prop(String name,
Boolean newProperty)
Set a new Boolean property in this node.
|
abstract SpinJsonNode |
prop(String name,
float newProperty)
Set a new float property in this node.
|
abstract SpinJsonNode |
prop(String name,
int newProperty)
Set a new int property in this node.
|
abstract SpinJsonNode |
prop(String name,
List<Object> newProperty)
Set a new List property in this node.
|
abstract SpinJsonNode |
prop(String name,
long newProperty)
Set a new long property in this node.
|
abstract SpinJsonNode |
prop(String name,
Map<String,Object> newProperty)
Set a new Map property in this node.
|
abstract SpinJsonNode |
prop(String name,
Number newProperty)
Set a new Number property in this node.
|
abstract SpinJsonNode |
prop(String name,
SpinJsonNode newProperty)
Set a new SpinJsonNode Object property in this node.
|
abstract SpinJsonNode |
prop(String name,
String newProperty)
Set a new String property in this node.
|
abstract SpinJsonNode |
remove(Object property)
Removes the first appearance of an object from the current array
|
abstract SpinJsonNode |
removeAt(int index)
removes an object at the specific index of the current array
|
abstract SpinJsonNode |
removeLast(Object property)
Removes the last appearance of an object from the current array
|
abstract String |
stringValue()
Get this node as a number value.
|
abstract Object |
value()
Gets the actual value of the node, in case it is a Boolean/String/Number/Null node.
|
public abstract Integer indexOf(Object searchObject)
searchObject
- Object for which the index should be searched.Integer
index of searchObject.SpinJsonException
- if the current node is not an array.SpinJsonPropertyException
- if object is not found.public abstract Integer lastIndexOf(Object searchObject)
searchObject
- Object for which the index should be searched.Integer
index of searchObject or -1 if object not found.SpinJsonException
- if the current node is not an array.public abstract boolean isObject()
public abstract boolean hasProp(String name)
name
- the name of the propertypublic abstract SpinJsonNode prop(String name)
name
- the name of the propertySpinJsonNode
representation of the propertypublic abstract SpinJsonNode prop(String name, String newProperty)
name
- the name of the new propertynewProperty
- the new String propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, Number newProperty)
name
- the name of the new propertynewProperty
- the new Number propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, int newProperty)
name
- the name of the new propertynewProperty
- the new int propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, float newProperty)
name
- the name of the new propertynewProperty
- the new float propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, long newProperty)
name
- the name of the new propertynewProperty
- the new long propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, boolean newProperty)
name
- the name of the new propertynewProperty
- the new boolean propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, Boolean newProperty)
name
- the name of the new propertynewProperty
- the new Boolean propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, List<Object> newProperty)
name
- the name of the new propertynewProperty
- the new List propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, Map<String,Object> newProperty)
name
- the name of the new propertynewProperty
- the new Map propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode prop(String name, SpinJsonNode newProperty)
name
- the name of the new propertynewProperty
- the new SpinJsonNode Object propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode deleteProp(String name)
name
- name of the propertySpinJsonNode
representation of the current nodepublic abstract SpinJsonNode deleteProp(List<String> names)
names
- list of namesSpinJsonNode
representation of the current nodepublic abstract SpinJsonNode append(Object property)
property
- property which should be appendSpinJsonNode
representation of the current nodepublic abstract SpinJsonNode insertAt(int index, Object property)
index
- Index in current node where the new property should be appended.property
- Object which should be appended.SpinJsonNode
representation of the current node.IllegalArgumentException
- if index is out of bound.public abstract SpinJsonNode insertBefore(Object searchObject, Object insertObject)
searchObject
- Object which is searchedinsertObject
- Object which will be insertedSpinJsonNode
representation of the current nodepublic abstract SpinJsonNode insertAfter(Object searchObject, Object insertObject)
searchObject
- Object which is searchedinsertObject
- Object which will be insertedSpinJsonNode
representation of the current nodepublic abstract SpinJsonNode remove(Object property)
property
- object which should be deletedSpinJsonNode
representation of the current nodepublic abstract SpinJsonNode removeLast(Object property)
property
- object which should be deletedSpinJsonNode
representation of the current nodepublic abstract SpinJsonNode removeAt(int index)
index
- Index of the arraySpinJsonNode
representation of the current nodeIllegalArgumentException
- if index is out of bound.public abstract Boolean isBoolean()
public abstract Boolean boolValue()
SpinDataFormatException
- if this node is not a boolean valuepublic abstract Boolean isNumber()
public abstract Number numberValue()
SpinDataFormatException
- if this node is not a number valuepublic abstract Boolean isString()
public abstract String stringValue()
SpinDataFormatException
- if this node is not a string valuepublic abstract Boolean isNull()
public abstract Boolean isValue()
public abstract Object value()
SpinDataFormatException
- if this node is not a Boolean/String/Number/Nul valuepublic abstract Boolean isArray()
public abstract SpinList<SpinJsonNode> elements()
SpinDataFormatException
- if this node is not a array valuepublic abstract List<String> fieldNames()
SpinDataFormatException
- if this node is not a array valuepublic abstract SpinJsonPathQuery jsonPath(String expression)
expression
- the JsonPath expressionCopyright © 2018 Camunda Services GmbH. All rights reserved.