Package net.obvj.confectory.mapper
Class INIToJSONObjectMapper
- java.lang.Object
-
- net.obvj.confectory.mapper.AbstractINIMapper<net.minidev.json.JSONObject>
-
- net.obvj.confectory.mapper.INIToJSONObjectMapper
-
- All Implemented Interfaces:
Mapper<net.minidev.json.JSONObject>
public class INIToJSONObjectMapper extends AbstractINIMapper<net.minidev.json.JSONObject> implements Mapper<net.minidev.json.JSONObject>
A specializedMapperthat loads the contents of a valid INISourceas aJSONObject.This allows fetching the contents using JSONPath expressions such as:
"$.section1.property1"- Since:
- 2.0.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description INIToJSONObjectMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.minidev.json.JSONObjectapply(InputStream inputStream)Applies thisMapperinto the given input.ConfigurationHelper<net.minidev.json.JSONObject>configurationHelper(net.minidev.json.JSONObject object)Creates a newConfigurationHelperinstance recommended by thisMapper.
-
-
-
Method Detail
-
apply
public net.minidev.json.JSONObject apply(InputStream inputStream) throws IOException
Description copied from interface:MapperApplies thisMapperinto the given input.Note: The input stream must be closed by the caller after the mapping operation.
- Specified by:
applyin interfaceMapper<net.minidev.json.JSONObject>- Parameters:
inputStream- the input stream to be mapped- Returns:
- the mapped object
- Throws:
IOException- if a low-level I/O problem (such and unexpected end-of-input, or network error) occurs
-
configurationHelper
public ConfigurationHelper<net.minidev.json.JSONObject> configurationHelper(net.minidev.json.JSONObject object)
Description copied from interface:MapperCreates a newConfigurationHelperinstance recommended by thisMapper.- Specified by:
configurationHelperin interfaceMapper<net.minidev.json.JSONObject>- Parameters:
object- the configuration object to be used by the helper- Returns:
- a new
ConfigurationHelperinstance
-
-