users@jaxb.java.net

Re: JAXB2 on-demand validation

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 15 Mar 2006 12:54:53 -0800

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.


> The istack thing is just because I tried to get running your
> jaxb2-reflection library.
> But this project seems to be stalled (what is a pitty, it's just what I
> need).
> See thread "jaxb2-reflection exception" on this list.

It's not stalled. I think there's something wrong with the auto-posting
machinary, as I posted in that thread. I'll look into it and fix it.


> I tried to fix it myself (that's why I looked for istack), but it looks like
> it cannot not to be done
> in a day or two. What plans do you have with jaxb2-reflection? I could put
> some effort on this,
> if you would tell me more about it. Is there a living community for it? Such
> a big work just right now unusable?

Thank you. I'm interested in knowing which part is not working
correctly. AFAIK, it's just a broken javadoc on the web, and the bundle
is just fine.

> As I realized, you are engaged in the JAXB2 development (sorry not knowing
> exactly) at Sun.
> Unfortunately, I should tell yout, that the "Java WEB Services Tutorial" for
> Java WEB Services
> Developer's pack 2.0 dated February 17, 2006 is very weak in the JAXB part.
> There is plenty
> of code not really working (such as u.setValidating( true ) at page 34) as
> well as examples not
> included in the distribution set, such as j2s-xmlAccessorOrderExample (which
> contradicts your
> jaxb2-reflection code).

Thank you very much for bringing that to our attention, and I'll forward
that to the doc team.


> No j2s-xmlAdapter-field, for instance (page 69).
> Furterhermore, this tutorial is more of an introduction.
> Important concepts are missing (on-demand validation?).

I'm sure our doc team appreciate feedbacks, so please send them along.

The tutorial is by definition meant to be an introductory, so I guess
you are saying we need more in-depth doc for people who finished the
tutorial.

Can you point me a few projects that in your opinion does a good job in
this area? I'd love to copy the way they do it.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com