Hi Romain, Nice work. I've taken a look at your component. A few minor suggestions for improvement, in case you want to contribute it to Apache:
- The component currently uses getContextClassLoader().loadClass() for classloading. Camel actually has a abstraction to make this portable across various runtime environments. You can just replace it with org.apache.camel.spi.ClassResolver().resolveClass(). - Avoid catching the NullPointException in the StAXJAXBIteratorExpression. - Do you plan to add a DSL method for the StAXJAXBIteratorExpression (requires patching camel-core)? So you can write for example "split(stax(Record.class))" in your route. Regards, Richard On Thu, May 12, 2011 at 5:55 PM, Romain Manni-Bucau <[email protected]>wrote: > Hi all, > > i worked a bit around stax (thanks to claus for its advices). > > You can find what i've done here: > http://code.google.com/p/rmannibucau/source/browse/camel/camel-stax/ > > The test show what can be done with it: > > http://code.google.com/p/rmannibucau/source/browse/camel/camel-stax/src/test/java/org/apache/camel/stax/test/StAXRouteTest.java > > - validation using sax (just need a converter) > - parsing using a sax contenthandler and a stax stream reader (a simple > component) > - parsing of sub tree to get jaxb objects using a stax event reader for > the whole tree and jaxb for the sub objects > > > - Romain >
