Class JsonProductSource

  • All Implemented Interfaces:
    ProductSource

    public class JsonProductSource
    extends java.lang.Object
    implements ProductSource
    Load a product from an InputStream containing Json.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonProductSource​(java.io.InputStream in)
      Create a new JsonProductSource.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Free any resources associated with this handler.
      void streamTo​(ProductHandler out)
      Begin reading the input stream, sending events to out.
      • Methods inherited from class java.lang.Object

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

      • JsonProductSource

        public JsonProductSource​(java.io.InputStream in)
        Create a new JsonProductSource.
        Parameters:
        in - the input stream where Json is read.
    • Method Detail

      • streamTo

        public void streamTo​(ProductHandler out)
                      throws java.lang.Exception
        Begin reading the input stream, sending events to out.
        Specified by:
        streamTo in interface ProductSource
        Parameters:
        out - the receiving ProductOutput.
        Throws:
        java.lang.Exception - if error occurs
      • close

        public void close()
        Free any resources associated with this handler.
        Specified by:
        close in interface ProductSource