Package com.caplin.streamlink
Interface JsonHandler
-
public interface JsonHandler
Handler for parsing and patching JSON objects
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
format(java.lang.Object obj)
Serializes a plain language object to its JSON string representation.java.lang.Object
parse(java.lang.String jsonString)
Parses a JSON string into a platform specific representation.java.lang.Object
patch(java.lang.Object existingObject, java.lang.String jsonPatchString)
Patches a platform specific JSON representation with an RFC 6902 JSON patch string.
-
-
-
Method Detail
-
parse
java.lang.Object parse(java.lang.String jsonString)
Parses a JSON string into a platform specific representation.- Parameters:
jsonString
- the string to parse- Returns:
- a platform specific representation of the JSON object
-
patch
java.lang.Object patch(java.lang.Object existingObject, java.lang.String jsonPatchString)
Patches a platform specific JSON representation with an RFC 6902 JSON patch string.- Parameters:
existingObject
- the platform specific JSON representationjsonPatchString
- the json patch string in RFC 6902 format- Returns:
- a platform specific representation of the patched JSON object
-
format
java.lang.String format(java.lang.Object obj)
Serializes a plain language object to its JSON string representation.- Parameters:
obj
- a plain language object- Returns:
- a JSON string representation of the object
- Throws:
java.lang.Exception
- if conversion fails
-
-