users@jaxb.java.net

Re: customize print and parse methods

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 25 Mar 2004 15:54:29 -0800

> Now i got new requirements!
> Supressing the zero should depend on the value of the
> V attribute from the 'Parameter' tag.
> Example:
> If <Parameter V="Param1"> then <Ergebniswert V="2"/>
> If <Parameter V="Param2"> then <Ergebniswert V="2.0"/>
>
> Is this possible with JAXB?

I'm afraid not. I guess in general terms what you need is an ability for
your print method to obtain some sort of context, which in your case
will let it access the value of V.

But I can't think of any way to do this today. The closest thing I can
think of is a thread local storage, but it's going to require some hack.

In your case where does the parameter element reside?

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