Class JSONDataLoader

  • All Implemented Interfaces:
    DataLoader

    public class JSONDataLoader
    extends FileDataLoader
    Creates a JSONNode based on a JSON file. The JSON file must contain a single JSON value on the top level, such as JSON object (like { "a": 1, "b": 2 }), an array, or even just a string, number, boolean or null.
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONDataLoader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object finalizeResult​(java.lang.Object jsonPOJO)
      Converts the POJO created from the JSON to its final form.
      protected java.lang.Object load​(java.io.InputStream in)
      FileDataLoader subclasess override this method to parse the file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JSONDataLoader

        public JSONDataLoader()
    • Method Detail

      • load

        protected java.lang.Object load​(java.io.InputStream in)
                                 throws java.lang.Exception
        Description copied from class: FileDataLoader
        FileDataLoader subclasess override this method to parse the file.
        Specified by:
        load in class FileDataLoader
        Throws:
        java.lang.Exception
      • finalizeResult

        protected java.lang.Object finalizeResult​(java.lang.Object jsonPOJO)
                                           throws java.lang.Exception
        Converts the POJO created from the JSON to its final form.
        Throws:
        java.lang.Exception