Package mjson

Class Json.help

  • Enclosing class:
    Json

    public static class Json.help
    extends Object

    Exposes some internal methods that are useful for Json.Factory implementations or other extension/layers of the library.

    Author:
    Borislav Iordanov
    • Constructor Detail

      • help

        public help()
    • Method Detail

      • escape

        public static String escape​(String string)

        Perform JSON escaping so that ", <, >, etc. characters are properly encoded in the JSON string representation before returning to the client code. This is useful when serializing property names or string values.

        Parameters:
        string - The string to escape so it can be used in a JSON serialization.
        Returns:
        the escaped string.
      • resolvePointer

        public static Json resolvePointer​(String pointer,
                                          Json element)

        Given a JSON Pointer, as per RFC 6901, return the nested JSON value within the element parameter.

        Parameters:
        pointer - The pointer in string format.
        element - The top-level element used to resolve the pointer.
        Returns:
        The JSON element to which the pointer resolves or null if the pointer does not resolve to anything.