Class JSONObjectMapper

  • All Implemented Interfaces:
    Mapper<net.minidev.json.JSONObject>

    public class JSONObjectMapper
    extends Object
    implements Mapper<net.minidev.json.JSONObject>
    A specialized Mapper that loads the contents of a valid JSON Source (e.g.: file, URL) as a JSONObject (json-smart JSON implementation).

    This allows fetching the contents using JSONPath expressions.

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

      • JSONObjectMapper

        public JSONObjectMapper()
    • 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 jsonObject)
        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:
        jsonObject - the configuration object to be used by the helper
        Returns:
        a new ConfigurationHelper instance