Jared Nedzel <jnedzel <at> broad.mit.edu> writes:

> Sean:
> 
> I've been meaning to take a closer look at JAXB.  Is your code open-source by
> any chance?

Jared,
I'm afraid not, but it is pretty straightforward. The JaxbRepresentation does
just what the DOM rep does. If given an xmlRep in construction, it unmarshals
it into a JAXB content tree. If given a tree, it just holds it. The 
write() method marshals the tree to the provided output stream.

The filter needs to be parameterized at construction with package and schema
information (the latter for validation as I recall). The beforeHandle() 
creates a JaxbRepresentation as sets it to the request entity. The
afterHandle() marshals a JaxbRepresentation into a string or xml rep.

There are some tricky bits if you are doing validation and if you want to
pool marshallers for performance and thread safety. 

Sorry I can't post code.

Sean

Reply via email to