Package mjson
Class Json.help
- java.lang.Object
-
- mjson.Json.help
-
- Enclosing class:
- Json
public static class Json.help extends Object
Exposes some internal methods that are useful for
Json.Factoryimplementations or other extension/layers of the library.- Author:
- Borislav Iordanov
-
-
Constructor Summary
Constructors Constructor Description help()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringescape(String string)Perform JSON escaping so that ", <, >, etc.static JsonresolvePointer(String pointer, Json element)Given a JSON Pointer, as per RFC 6901, return the nested JSON value within theelementparameter.
-
-
-
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
elementparameter.- 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
nullif the pointer does not resolve to anything.
-
-