Class 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 specialized Mapper that loads the contents of a valid INI Source as a JSONObject.

    This allows fetching the contents using JSONPath expressions such as: "$.section1.property1"

    Since:
    2.0.0
    Author:
    oswaldo.bapvic.jr (Oswaldo Junior)
    • Constructor Detail

      • INIToJSONObjectMapper

        public INIToJSONObjectMapper()
    • Method Detail

      • apply

        public net.minidev.json.JSONObject apply​(InputStream inputStream)
                                          throws IOException
        Description copied from interface: Mapper
        Applies this Mapper into the given input.

        Note: The input stream must be closed by the caller after the mapping operation.

        Specified by:
        apply in interface Mapper<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: Mapper
        Creates a new ConfigurationHelper instance recommended by this Mapper.
        Specified by:
        configurationHelper in interface Mapper<net.minidev.json.JSONObject>
        Parameters:
        object - the configuration object to be used by the helper
        Returns:
        a new ConfigurationHelper instance