JAXB/MOXy: How to partially unmarshall, passing the descendants of a given node to a closed/proprietary class?

Ended up using both an XmlAdapter and a DomHandler along with a simple Wrapper class.

Ended up using both an XmlAdapter and a DomHandler along with a simple Wrapper class. Public class FooWrapper { @XmlAnyElement(FooDomHandler. Class) public ProprietaryFoo foo; } public class FooXmlAdapter extends XmlAdapter { @Override public ProprietaryFoo unmarshal(FooWrapper w) throws Exception { return w.

Foo; } @Override public FooWrapper marshal(ProprietaryFoo f) throws Exception { FooWrapper fooWrapper = new FooWrapper(); fooWrapper. Foo = f; return fooWrapper; } } /* The vendor also provides a ProprietaryFooResult class that extends SAXResult */ public class FooDomHandler implements DomHandler { @Override public ProprietaryFooResult createUnmarshaller(ValidationEventHandler validationEventHandler) { return new ProprietaryFooResult(); } @Override public ProprietaryFoo getElement(ProprietaryFooResult r) { return r. GetProprietaryFoo(); } @Override public Source marshal(ProprietaryFoo f, ValidationEventHandler validationEventHandler) { return f.asSaxSource(); } } For whatever reason, this didn't work with the standard classes from the com.

Sun namespace but MOXy handles it well.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions