MotechJsonReader¶
-
public class
MotechJsonReader¶ Class responsible for creating objects from json. It can use
InputStream,Stringor file classpath. This class uses Gson underneath.See also: Google Gson
Constructors¶
Methods¶
readFromFile¶
readFromStream¶
-
public Object
readFromStream(InputStream stream, Type ofType)¶ Creates object of type
ofTypefrom input stream.Parameters: - stream – the stream to deserialize
- ofType – the type of created object
Returns: object of type
ofType
readFromStreamOnlyExposeAnnotations¶
-
public Object
readFromStreamOnlyExposeAnnotations(InputStream stream, Type ofType)¶ Creates object of type
ofTypefrom input stream. Will only deserialize fields withExposeannotation.Parameters: - stream – the stream to deserialize
- ofType – the type of created object
Returns: object of type
ofType
readFromString¶
readFromString¶
-
public Object
readFromString(String text, Type ofType, Map<Type, Object> typeAdapters)¶ Creates object of type
ofTypefrom givenStringusing user-specified adapters.Parameters: - text – the
Stringto deserialize - ofType – the type of created object
- typeAdapters – custom adapters to use for deserialization
Returns: object of type
ofType- text – the