Package net.obvj.confectory.mapper
Class YAMLToObjectMapper<T>
- java.lang.Object
-
- net.obvj.confectory.mapper.YAMLToObjectMapper<T>
-
- Type Parameters:
T- the target type to be produced by thisMapper
- All Implemented Interfaces:
Mapper<T>
- Direct Known Subclasses:
YAMLToJSONObjectMapper
public class YAMLToObjectMapper<T> extends Object implements Mapper<T>
A specializedMapperthat loads the contents of a valid YAMLSource(e.g.: file, URL, string) into POJO (Plain Old Java Object), using SnakeYAML.This allows fetching the contents using JSONPath expressions.
- Since:
- 1.1.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description YAMLToObjectMapper(Class<T> targetType)Builds a new YAML mapper with the specified target type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tapply(InputStream input)ConfigurationHelper<T>configurationHelper(T jsonObject)
-
-
-
Method Detail
-
apply
public T apply(InputStream input) throws IOException
- Specified by:
applyin interfaceMapper<T>- Throws:
IOException
-
configurationHelper
public ConfigurationHelper<T> configurationHelper(T jsonObject)
- Specified by:
configurationHelperin interfaceMapper<T>
-
-