Package sk.antons.json.impl
Class JsonArrayImpl
java.lang.Object
sk.antons.json.impl.JsonValueImpl
sk.antons.json.impl.JsonArrayImpl
- All Implemented Interfaces:
JsonGroup,JsonMember,JsonArray,JsonValue
- Author:
- antons
-
Field Summary
Fields inherited from class sk.antons.json.impl.JsonValueImpl
group -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds new element to json array.Adds new element to json array at specified position.Converts value to value usable for some template frameworks.voidclear()Clears content of json array.copy()Makes deep copy of this value.voidfindFirst(PathMatcher matcher, List<String> path) first()Reads first element of json array.get(int index) Reads n'th item from json array.booleanisEmpty()Checks if this json array contains no value.last()Reads last element of json array.intremove(int index) Removes n'th element from json array.voidvoidintsize()Size of json array.protected voidtoList()Converts this instance to regulat list of values.protected voidtoPrettyString(Appendable sb, String prefix, String indent) values()Methods inherited from class sk.antons.json.impl.JsonValueImpl
asArray, asBoolLiteral, asExpLiteral, asFracLiteral, asIntLiteral, asLiteral, asNullLiteral, asObject, asStringLiteral, find, find, findAll, findAllLiterals, findFirst, findFirstLiteral, group, isArray, isBoolLiteral, isDescendantOf, isExpLiteral, isFracLiteral, isIntLiteral, isLiteral, isNullLiteral, isObject, isStringLiteral, name, parent, parentIndex, path, pathAsString, remove, replaceBy, setGroup, toCompactString, toPrettyString, writeCompact, writePrettyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface sk.antons.json.impl.JsonGroup
isDescendantOfMethods inherited from interface sk.antons.json.impl.JsonMember
group, setGroupMethods inherited from interface sk.antons.json.JsonValue
asArray, asBoolLiteral, asExpLiteral, asFracLiteral, asIntLiteral, asLiteral, asNullLiteral, asObject, asStringLiteral, find, find, findAll, findAllLiterals, findFirst, findFirstLiteral, isArray, isBoolLiteral, isDescendantOf, isExpLiteral, isFracLiteral, isIntLiteral, isLiteral, isNullLiteral, isObject, isStringLiteral, name, parent, parentIndex, path, pathAsString, remove, replaceBy, toCompactString, toPrettyString, writeCompact, writePretty
-
Constructor Details
-
JsonArrayImpl
public JsonArrayImpl()
-
-
Method Details
-
values
-
toCompactString
- Specified by:
toCompactStringin classJsonValueImpl
-
toPrettyString
- Specified by:
toPrettyStringin classJsonValueImpl
-
isEmpty
public boolean isEmpty()Description copied from interface:JsonArrayChecks if this json array contains no value. -
size
public int size()Description copied from interface:JsonArraySize of json array. -
clear
public void clear()Description copied from interface:JsonArrayClears content of json array. -
get
Description copied from interface:JsonArrayReads n'th item from json array. -
remove
Description copied from interface:JsonArrayRemoves n'th element from json array. -
first
Description copied from interface:JsonArrayReads first element of json array. -
last
Description copied from interface:JsonArrayReads last element of json array. -
add
Description copied from interface:JsonArrayAdds new element to json array. -
add
Description copied from interface:JsonArrayAdds new element to json array at specified position. -
toList
Description copied from interface:JsonArrayConverts this instance to regulat list of values. -
memberIndex
- Specified by:
memberIndexin interfaceJsonGroup
-
findFirst
- Specified by:
findFirstin classJsonValueImpl
-
findAll
- Specified by:
findAllin classJsonValueImpl
-
remove
-
replaceBy
-
copy
Description copied from interface:JsonValueMakes deep copy of this value. -
asTemplateParam
Description copied from interface:JsonValueConverts value to value usable for some template frameworks. - JsonObjects is converted to read only Map - JsonArray is converted to read only List - JsonLiteral is converted to its java value- Specified by:
asTemplateParamin interfaceJsonValue- Returns:
- template parameter form of this value
-