public interface JsonObject extends JsonValue
| Modifier and Type | Method and Description |
|---|---|
JsonObject |
add(String name,
JsonValue value)
Adds attribute ti this json object at last position.
|
JsonObject |
add(String name,
JsonValue value,
int index)
Adds attribute ti this json object at specified position.
|
List<JsonValue> |
all(String name)
Values of all attributes with specidied name
|
JsonAttribute |
attr(int index)
Reads n'th attribute of this json object
|
JsonAttribute |
attr(String name)
Reads first attribute of this json object with specified name
|
List<JsonAttribute> |
attrs(String name)
Reads all attributes of this json object with specified name
|
void |
clear()
Clears all attributes from this json object.
|
JsonValue |
first()
Returns value of first attribute.
|
JsonValue |
first(String name)
Value of first attribute with specidied name
|
int |
firstIndex(String name)
Index of first attribute with specidied name
|
boolean |
isEmpty()
Checks if object has any attribute.
|
JsonValue |
last()
Returns value of last attribute.
|
JsonObject |
removeAll(String name)
Removes all values with specified name.
|
JsonAttribute |
removeAttr(int index)
Removes n'th attribute from this json object.
|
int |
size()
Size of json object.
|
List<JsonAttribute> |
toList()
Converts attributes to regular list.
|
asArray, asBoolLiteral, asExpLiteral, asFracLiteral, asIntLiteral, asLiteral, asNullLiteral, asObject, asStringLiteral, findAll, findAllLiterals, findFirst, findFirstLiteral, isArray, isBoolLiteral, isExpLiteral, isFracLiteral, isIntLiteral, isLiteral, isNullLiteral, isObject, isStringLiteral, parent, parentIndex, path, remove, toCompactString, toPrettyStringboolean isEmpty()
int size()
void clear()
JsonAttribute attr(int index)
index - of the attribute which is read (first attribute has index=0)JsonAttribute attr(String name)
name - of the attribute which is read (first attribute with the name will be returned)List<JsonAttribute> attrs(String name)
name - of the attributes which is read (all attributes with the name will be returned)JsonAttribute removeAttr(int index)
index - position of attribute which should be removedList<JsonAttribute> toList()
JsonValue first()
JsonValue last()
JsonObject add(String name, JsonValue value)
name - name of the attributevalue - value of the attributeJsonObject add(String name, JsonValue value, int index)
name - name of the attributevalue - value of the attributeindex - position of the attributeint firstIndex(String name)
name - name of the attribute which should be foundJsonValue first(String name)
name - name of the attribute which should be foundList<JsonValue> all(String name)
name - name of the attributes which should be foundJsonObject removeAll(String name)
name - of attributes to be removedCopyright © 2018. All rights reserved.