users@jaxb.java.net

Re: Three problems: how to solve?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 11 Dec 2003 08:42:26 -0800

> 1. Given an unmarshalled object, return its parent object (the parent
> element in the serialized XML)

We don't have a native way to do this right now. I suggest you file an
RFE for this, so that we can track how many people want it.

One of the reasons why it's not done is because the parent/child
relationship has to be maintained properly. So when you move an object
from one parent to another, the child has to be removed from the old
parent and etc. This requires a custom List implementation which many
people hates.

But I can see that there's use in the getParent method.



> 2. Generate an event when a field (attribute or child element) is changed

I'm afraid we don't do this today. Again this would require a custom
List implementation, but otherwise it's not that hard to implement,
technically.

> 3. Intervene with custom execution immediately after an element has been
> completely unmarshalled (i.e., execute under a guarantee that all child
> attributes and elements have been unmarshalled and that no other code
> intervenes between the time this condition is met and the custom execution
> begins)

Seems like you can put your processing right after the
Unmarshaller.unmarshal method returns. Or do you want it to be
per-object based?

The other two issues have spec angles, so the RI cannot just go ahead
and do it, but this one we might be able to do. Could you elaborate a
bit?


regards,
--
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