Package com.github.tnakamot.json.pointer
Class JSONPointerReferenceToken
- java.lang.Object
-
- com.github.tnakamot.json.pointer.JSONPointerReferenceToken
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
beginningLocation()
Location of the beginning of the token within the original JSON Pointer string.int
endLocation()
Location of the end of the token within the original JSON Pointer string.int
index()
Reference token as an index of a JSON array value.String
name()
Unescaped reference token as a member name of a JSON object value.String
parent()
String representation of the JSON Pointer of the parent.JSONPointer
pointer()
JSON Pointer that this reference token belongs to.JSONPointerReferenceToken
previous()
Previous reference token which represents a parent node.String
text()
escaped reference token.
-
-
-
Method Detail
-
previous
public JSONPointerReferenceToken previous()
Previous reference token which represents a parent node.- Returns:
- Previous reference token which represents a parent node. Null if this is the root value.
-
parent
public String parent()
String representation of the JSON Pointer of the parent. If this is the parent is the root value, this method returns an empty string.- Returns:
- string representation of the JSON Pointer of the parent.
-
name
public String name()
Unescaped reference token as a member name of a JSON object value.- Returns:
- Unescaped reference token.
-
index
public int index() throws InvalidJSONPointerNotIndexException
Reference token as an index of a JSON array value.- Returns:
- index of a JSON array value
- Throws:
InvalidJSONPointerNotIndexException
-
text
public String text()
escaped reference token.- Returns:
- escaped reference token.
-
beginningLocation
public int beginningLocation()
Location of the beginning of the token within the original JSON Pointer string.- Returns:
- location of the beginning of the token within the original JSON Pointer string.
-
endLocation
public int endLocation()
Location of the end of the token within the original JSON Pointer string.- Returns:
- location of the end of the token within the original JSON Pointer string.
-
pointer
public JSONPointer pointer()
JSON Pointer that this reference token belongs to.- Returns:
- JSON Pointer that this token belongs to.
-
-