Class ScriptingJsonObject
java.lang.Object
com.flowable.platform.engine.impl.scripting.ScriptingJsonObject
- All Implemented Interfaces:
ScriptingJsonNode,Iterable<ScriptingJsonNode>,Supplier<com.fasterxml.jackson.databind.JsonNode>
public class ScriptingJsonObject
extends Object
implements Supplier<com.fasterxml.jackson.databind.JsonNode>, ScriptingJsonNode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBoolean(Boolean value) addDouble(double value) addFloat(float value) addInt(int value) addInteger(Number value) addLong(long value) addNull()addShort(short value) asDouble()asLong()asString()protected voidcheckForNull(String action) protected com.fasterxml.jackson.databind.node.ArrayNodecheckIsArrayNode(String action) protected com.fasterxml.jackson.databind.node.ObjectNodecheckIsObjectNode(String action) createChildArray(String fieldName) createChildObject(String fieldName) com.fasterxml.jackson.databind.JsonNodeget()com.fasterxml.jackson.databind.JsonNodebooleanisArray()booleanbooleanbooleanisNumber()booleanisObject()booleanbooleanisString()booleanisValue()iterator()path(int index) putBoolean(String fieldName, Boolean value) putInteger(String fieldName, Number value) intsize()toString()Returns a toString representation of this ScriptingJsonObject.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
jsonNode
protected com.fasterxml.jackson.databind.JsonNode jsonNode
-
-
Constructor Details
-
ScriptingJsonObject
public ScriptingJsonObject(com.fasterxml.jackson.databind.JsonNode jsonNode)
-
-
Method Details
-
createChildObject
- Specified by:
createChildObjectin interfaceScriptingJsonNode
-
createChildArray
- Specified by:
createChildArrayin interfaceScriptingJsonNode
-
putString
- Specified by:
putStringin interfaceScriptingJsonNode
-
putInteger
- Specified by:
putIntegerin interfaceScriptingJsonNode
-
putInt
- Specified by:
putIntin interfaceScriptingJsonNode
-
putBoolean
- Specified by:
putBooleanin interfaceScriptingJsonNode
-
putShort
- Specified by:
putShortin interfaceScriptingJsonNode
-
putShort
- Specified by:
putShortin interfaceScriptingJsonNode
-
putLong
- Specified by:
putLongin interfaceScriptingJsonNode
-
putLong
- Specified by:
putLongin interfaceScriptingJsonNode
-
putDouble
- Specified by:
putDoublein interfaceScriptingJsonNode
-
putDouble
- Specified by:
putDoublein interfaceScriptingJsonNode
-
putFloat
- Specified by:
putFloatin interfaceScriptingJsonNode
-
putFloat
- Specified by:
putFloatin interfaceScriptingJsonNode
-
putObject
- Specified by:
putObjectin interfaceScriptingJsonNode
-
putNull
- Specified by:
putNullin interfaceScriptingJsonNode
-
addString
- Specified by:
addStringin interfaceScriptingJsonNode
-
addInteger
- Specified by:
addIntegerin interfaceScriptingJsonNode
-
addInt
- Specified by:
addIntin interfaceScriptingJsonNode
-
addBoolean
- Specified by:
addBooleanin interfaceScriptingJsonNode
-
addShort
- Specified by:
addShortin interfaceScriptingJsonNode
-
addShort
- Specified by:
addShortin interfaceScriptingJsonNode
-
addLong
- Specified by:
addLongin interfaceScriptingJsonNode
-
addLong
- Specified by:
addLongin interfaceScriptingJsonNode
-
addDouble
- Specified by:
addDoublein interfaceScriptingJsonNode
-
addDouble
- Specified by:
addDoublein interfaceScriptingJsonNode
-
addFloat
- Specified by:
addFloatin interfaceScriptingJsonNode
-
addFloat
- Specified by:
addFloatin interfaceScriptingJsonNode
-
addObject
- Specified by:
addObjectin interfaceScriptingJsonNode
-
addNull
- Specified by:
addNullin interfaceScriptingJsonNode
-
path
- Specified by:
pathin interfaceScriptingJsonNode
-
path
- Specified by:
pathin interfaceScriptingJsonNode
-
size
public int size()- Specified by:
sizein interfaceScriptingJsonNode- Returns:
- the number of elements for this json node (array length for array nodes or number of attributes for object nodes).
-
asInteger
- Specified by:
asIntegerin interfaceScriptingJsonNode- Returns:
- this value as integer in case it is a numeric value.
- Throws:
FlowableException- when this node is empty or null, not a number or exceeds integer range.
-
asLong
- Specified by:
asLongin interfaceScriptingJsonNode- Returns:
- this number value as long.
- Throws:
FlowableException- when this node is empty or null or not a number.
-
asBoolean
- Specified by:
asBooleanin interfaceScriptingJsonNode- Returns:
- this value as boolean.
- Throws:
FlowableException- when this node is empty or null or not a boolean.
-
asDouble
- Specified by:
asDoublein interfaceScriptingJsonNode- Returns:
- this number value as double.
- Throws:
FlowableException- when this node is empty or null or not a number.
-
asString
- Specified by:
asStringin interfaceScriptingJsonNode- Returns:
- a string representation of this node, if this node is a value node (
isValue()returns true). - Throws:
FlowableException- when this node is not a value node.
-
iterator
- Specified by:
iteratorin interfaceIterable<ScriptingJsonNode>- Returns:
- an iterator of this node. Wraps each object into a ScriptingJsonObject when this node is an array node. Otherwise, a single item iterator is returned.
-
fieldNames
- Specified by:
fieldNamesin interfaceScriptingJsonNode- Returns:
- collection of field names for object nodes. Empty collection for non-object nodes.
-
isValue
public boolean isValue()- Specified by:
isValuein interfaceScriptingJsonNode- Returns:
- true if this json node is a value node.
-
isArray
public boolean isArray()- Specified by:
isArrayin interfaceScriptingJsonNode- Returns:
- true if this json node is an array node.
-
isObject
public boolean isObject()- Specified by:
isObjectin interfaceScriptingJsonNode- Returns:
- true if this json node is an object node.
-
isString
public boolean isString()- Specified by:
isStringin interfaceScriptingJsonNode- Returns:
- true if this json node is a string
-
isNumber
public boolean isNumber()- Specified by:
isNumberin interfaceScriptingJsonNode- Returns:
- true if this json node is a number
-
isBoolean
public boolean isBoolean()- Specified by:
isBooleanin interfaceScriptingJsonNode- Returns:
- true if this json node is a boolean
-
isNonNull
public boolean isNonNull()- Specified by:
isNonNullin interfaceScriptingJsonNode
-
isPresent
public boolean isPresent()- Specified by:
isPresentin interfaceScriptingJsonNode
-
checkForNull
-
checkIsObjectNode
-
checkIsArrayNode
-
get
public com.fasterxml.jackson.databind.JsonNode get() -
getJsonNode
public com.fasterxml.jackson.databind.JsonNode getJsonNode() -
toString
Returns a toString representation of this ScriptingJsonObject.NOTE: Even though this method returns some json content, do not rely on it for parsing the content. Use a proper json generator to create a json string instead e.g.
ScriptingJsonUtils.jsonToString(ScriptingJsonNode)
-