-
- All Implemented Interfaces:
public final class JSONReferenceA JSON Reference - a combination of a JSON Pointer and the JSON value to which it refers. This allows for a single object to be used (and passed as a parameter or a return value between functions) in the common case of a pointer being employed to navigate a tree of JSON values.
-
-
Constructor Summary
Constructors Constructor Description JSONReference(JSONValue base)
-
Method Summary
Modifier and Type Method Description final JSONPointergetPointer()final JSONValuegetBase()final BooleangetValid()final JSONValuegetValue()final BooleanhasChild(String name)final BooleanhasChild(Integer index)final JSONReferenceparent()final JSONReferencechild(String name)final JSONReferencechild(Integer index)final JSONReferencelocateChild(JSONValue target)final UnitoptionalString(String name, Function2<JSONReference, String, Unit> block)final <T extends JSONValue> UnitoptionalJSON(String name, Function2<JSONReference, T, Unit> block)final <T extends JSONValue, V extends Any> VcheckType(JSONValue value, Function2<JSONReference, T, V> block)final UnitforEach(Function1<JSONReference, Unit> block)final UnitforEachItem(Function1<JSONReference, Unit> block)final UnitforEachProperty(Function1<JSONReference, Unit> block)Booleanequals(Object other)IntegerhashCode()StringtoString()-
-
Method Detail
-
getPointer
final JSONPointer getPointer()
-
getBase
final JSONValue getBase()
-
getValue
final JSONValue getValue()
-
parent
final JSONReference parent()
-
child
final JSONReference child(String name)
-
child
final JSONReference child(Integer index)
-
locateChild
final JSONReference locateChild(JSONValue target)
-
optionalString
final Unit optionalString(String name, Function2<JSONReference, String, Unit> block)
-
optionalJSON
final <T extends JSONValue> Unit optionalJSON(String name, Function2<JSONReference, T, Unit> block)
-
checkType
final <T extends JSONValue, V extends Any> V checkType(JSONValue value, Function2<JSONReference, T, V> block)
-
forEach
final Unit forEach(Function1<JSONReference, Unit> block)
-
forEachItem
final Unit forEachItem(Function1<JSONReference, Unit> block)
-
forEachProperty
final Unit forEachProperty(Function1<JSONReference, Unit> block)
-
-
-
-