jpcik/morph — pull request #8 by seralf (2014-03-14 12:55:20+00:00)
Title: added: registerListeners, fluent api, companion object to a Morph suggested implementation

Hi

I have added a method for enable callers to register listeners on the Jena Model/Graph before insert the mapped data into it.
This turns to be very useful for writing very large files, as it's possible to create a subclass of GraphListenerBase which for example append a triple on an opened stream while it is added to the Model/Graph.
It is also possible to use one of these listener to directly push data on a triplestore (for example I'm using a Virtuoso instance, but the idea can be generalized).

If you like the idea, it's possible to create also listeners based on the ModelChangeListener interface.

Moreover I have added a class AlternativeMoprh with a slight refactorng of the main class to use those listener registration, using a fluent api. The JBC and REST model are here generated using factory methods fro ma companion object. I left the original class in order to avoid breaking funcionalities: feel free to drop the implementation, rename/refactor it or merge the twos.