users@jaxb.java.net

Re: Using JAXB Generated Classes as Beans

From: Adam Sherman <adam_at_tritus.ca>
Date: Wed, 29 Oct 2003 13:49:17 -0500

On 10/29/03 10:45:19 -0800 Kohsuke Kawaguchi wrote:

>> I would like to use the generated classes behind forms being serviced by
>> a web framework (Think Struts, Spring, WW, etc).
>>
>> The problem is that most, if not all, of these frameworks expect to be
>> able to simply instantiate a Bean and use it.
>>
>> This can't be done with the generated classes, AFAIK.
>
> You can create implementation classes directly if you want. For example,
> if you want a bean for abc.def.Foo, you can just do new
> abc.def.impl.FooImpl();
>
> I guess this won't be portable, but as a workaround, it might be OK for
> you.

That's what I will do for now. Any thoughts on the future of doing this?

Another related question: upon creation of Foo, foo.getBar() returns null.
It would be better for me if it returned an empty Bar object. Thoughts?

Thanks,

A.


-- 
Adam Sherman
Tritus CG Inc
+1 (613) 797-6819
http://www.tritus.ca/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net