users@jaxb.java.net

Re: Some codemodel questions

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 14 May 2007 17:26:53 -0700

Colin Fleming wrote:
> Also, I don't fully understand when an element factory method will be
> added to the ObjectFactory. The following schema seems to create one:

For every generated class and element declaratoin it will do so.

>
> <xs:element name="isomsg" type="IsoMessage"/>
>
> but the following doesn't:
>
> <xs:element name="Users">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="cardUser" type="User" minOccurs="0"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> Can I test if a createXXX function is generated on the ObjectFactory
> using the codemodel? I couldn't find anything in either ClassOutline,
> CClassInfo or JDefinedClass that would tell me. I thought
> CClassInfo.isElement and getElementName might do the trick, but it
> seems not. Also, is there any way to get a reference to the create
> function generated on the ObjectFactory (or, even better, a reference
> to the ObjectFactory class) so I can invoke it?

I wonder if something is available on ObjectFactoryGenerator.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com