Package com.inrupt.client.spi
Interface JsonService
public interface JsonService
A JSON handling abstraction.
-
Method Summary
Modifier and TypeMethodDescription<T> TfromJson(InputStream input, Class<T> clazz) Read JSON into a java object.<T> TfromJson(InputStream input, Type type) Read JSON into a java object.<T> voidtoJson(T object, OutputStream output) Write object data into JSON.
-
Method Details
-
toJson
Write object data into JSON.- Type Parameters:
T- the object type- Parameters:
object- the object to serializeoutput- the output stream- Throws:
IOException- when there is a serialization error
-
fromJson
Read JSON into a java object.- Type Parameters:
T- the object type- Parameters:
input- the input streamclazz- the object class- Returns:
- the newly created object
- Throws:
IOException- when there is a parsing error
-
fromJson
Read JSON into a java object.- Type Parameters:
T- the object type- Parameters:
input- the input streamtype- the runtime type of the object- Returns:
- the newly created object
- Throws:
IOException- when there is a parsing error
-