JsonNode object reference
The JsonNode object represents the attributes of an identity.
Groovy sample
// Only allow access if the user is in the group "staff"
def groups = exc?.identity?.attributes?.get("groups")
foundGroup = falseif (groups) {
for (group in groups) {
if ("staff".equals(group.asText())) {
foundGroup = truebreak
}
}
}
if (foundGroup) {
pass()
} else {
fail()
}
Method summary
Method | Description |
---|---|
|
Gets the JsonNode representing a field of this JsonNode. This method will return null if no field exists with the specified name. |
|
Returns true if this JsonNode has a field with the specified name. |
|
Returns an java.util.Iterator providing access to the names of all the fields of this JsonNode. |
|
Returns true if this JsonNode represents a string value. |
|
Returns a string representation of this JsonNode. If this JsonNode is an array or object, this will return an empty string. |
|
Returns an integer representation of this JsonNode. If this JsonNode does not represent a number, 0 is returned. |
|
Returns true if this JsonNode is an array. |
|
Returns true if this JsonNode is an object. |
|
For an array JsonNode, returns the number of elements in the array. For an object JsonNode, returns the number of fields in the object. 0 otherwise. |
|
Returns an java.util.Iterator over all JsonNode objects contained in this JsonNode. For an array JsonNode, the returned java.util.Iterator will iterate over all the elements in the array. For an object JsonNode, the returned java.util.Iterator will iterate over all field values in the object. |