Package net.obvj.confectory.mapper
Class GsonJsonToObjectMapper<T>
- java.lang.Object
-
- net.obvj.confectory.mapper.GsonJsonToObjectMapper<T>
-
- Type Parameters:
T- the target type to be produced by thisMapper(the target class may contain Gson annotations for due mapping -- e.g.:@SerializedName)
- All Implemented Interfaces:
Mapper<T>
- Direct Known Subclasses:
GsonJsonObjectMapper
public class GsonJsonToObjectMapper<T> extends Object implements Mapper<T>
A specializedMapperthat loads the contents of a valid JSONSource(e.g.: file, URL, string) into POJO (Plain Old Java Object), using Gson.Additional details may be found at Gsons's official documentation.
- Since:
- 0.4.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description GsonJsonToObjectMapper(Class<T> targetType)Builds a new JSON mapper with the specified target type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tapply(InputStream inputStream)ConfigurationHelper<T>configurationHelper(T object)
-
-
-
Method Detail
-
apply
public T apply(InputStream inputStream) throws IOException
- Specified by:
applyin interfaceMapper<T>- Throws:
IOException
-
configurationHelper
public ConfigurationHelper<T> configurationHelper(T object)
- Specified by:
configurationHelperin interfaceMapper<T>
-
-