users@jaxb.java.net

Re: JAXB2 on-demand validation

From: Malachi de Ælfweald <malachid_at_gmail.com>
Date: Wed, 15 Mar 2006 13:02:10 -0800

Depending on the usage of your application, it might be worth marshalling it
to a StringWriter so that your GUI auto-reformats (etc).

Malachi


On 3/15/06, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com> wrote:
>
> wiedkla wrote:
> > How to tell...?
> > I thought, on-demand validation is independent from
> > marshalling/unmarshalling.
> > I have to do a GUI for input of XML data controlled by (of course) an
> xsd.
> > I have to validate each input, which is stored in JAXB generated code,
> on
> > the fly.
> > No marshalling required at this point. Shall I really marshall after
> each
> > user input?
>
> In terms of the work, on-demand validation and marshalling does the
> same. So if you've been validating after each user input, you should
> "marshal" after each user input --- you should do so to a special
> OutputStream that doesn't write to anywhere, since you are only
> interested in getting the validation as a side effect.
>