users@jaxb.java.net

Re: JAXB - Automatic creation of mandatory children

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 21 Sep 2004 15:11:39 +0200

Hi.

> I have a wrapper class that has methods for
> marshaling/unmarshalling. These are the methods in it.
> public Rbml unmarshal() throws java.lang.Exception {
> Unmarshaller u = jc.createUnmarshaller();
> u.setEventHandler(new ValidationEventHandler()
> {
> public boolean handleEvent(ValidationEvent event)
> {
> return true;
> }
> });
>
> return (Rbml)u.unmarshal(new
> FileInputStream(inputFilename));
> }
>
> public void marshal(Rbml rbml) throws
> java.lang.Exception {
> Marshaller m = jc.createMarshaller();
> m.setEventHandler(new ValidationEventHandler()
> {
> public boolean handleEvent(ValidationEvent event)
> {
> return true;
> }
> });
>
> m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,new
> Boolean(true));
> m.marshal(rbml, new
> FileOutputStream(outputFilename));
> }

Sorry, I can't advise anything at the moment.

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net