Class JSONPointer


  • public class JSONPointer
    extends Object
    JSON Pointer implementation compliant with RFC 6901.

    Instances of this class are immutable.

    See Also:
    RFC 6901
    • Constructor Detail

      • JSONPointer

        public JSONPointer​(String text,
                           boolean fragment)
                    throws InvalidJSONPointerSyntaxException
        Create a new JSON Pointer instance from a Java String.
        Parameters:
        text - String which represents a JSON pointer
        fragment - specify true to handle the given string as a URI fragment identifier starting with '#".
        Throws:
        InvalidJSONPointerSyntaxException - when the given String cannot be interpreted as a JSON Pointer.
      • JSONPointer

        public JSONPointer​(JSONValueString value,
                           boolean fragment)
                    throws InvalidJSONPointerSyntaxException
        Create a new JSON Pointer instance from a JSON string value.
        Parameters:
        value - a JSON string value which represents a JSON pointer
        fragment - specify true to handle the given string as a URI fragment identifier starting with '#".
        Throws:
        InvalidJSONPointerSyntaxException - when the given string cannot be interpreted as a JSON Pointer.
    • Method Detail

      • text

        public String text()
        Return the pointer string.
        Returns:
        the original pointer string