users@jaxb.java.net

Re: ValidationEventHandler returns only parent object through ValidationEvent.getLocator().getObject()

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 30 Sep 2004 13:38:14 -0700

Aleksei Valikov wrote:
>> Another thing is, those constraint checks on objects are by no means
>> limited to JAXB --- you could have the same problem with Hibernate, for
>> example.
>
> The task might be the same, but JAXB is different, as it deals with
> schematic models of object structures - including constraint
> information. In principal, JAXB has enough information to construct
> "object validator" you're mentioning below.

JAXB can help contribute the constraint set it finds in the schema.

My point is that:

- there are many other sources that can feed constraints into
   the object validator (say, RDBMS)
- you often want to add more constraints into the object validator
- the object validator can be used by many frameworks (JSF, for example)

> This seems to be a very good task, but quite complex, I'd say...
> I've been working with XJC internals quite a lot last three month and
> I'm not sure I have enough qualification/resources to implement such a
> "constraint compiler".
> Hm. I'll need to research this later...

I think the object validator should be built outside JAXB. In
particular, it should define its own API to interact with applications,
and it should define how constraints can be defined.

Then I think we can have an XJC extension that produces those constraint
set along with the beans.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net