0

In brief: I have java.io.InputStream which contains json with a huge array of sub-elements. Following call gives me fully populated collection after processing is finished: smooks.filterSource(exCtxt, new StreamSource(inputStream), javaResult).

How can I retrieve objects on the fly, on every sub-element? (e.g. via callback)

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138

1 Answers1

0

If someone needs it, I did object streaming with Smooks this way:

smooks.addVisitor(new SAXVisitAfter() {
        @Override
        public void visitAfter(SAXElement element,
                ExecutionContext executionContext) throws SmooksException,
                IOException {
            MyElement element = (MyElement) executionContext.getBeanContext()
                    .getBean("myElement");
            // send 'element' here;
        }
    }, "root/element");