users@jaxb.java.net

Re: Re: XJC Plugin development question

From: Malachi de $(D)!(Jlfweald <malachid_at_gmail.com>
Date: Mon, 13 Mar 2006 06:50:13 -0800

Hmmm, that is very odd.... I am running XJC 2.0-beta from jaxb-ri-20051223
and it doesn't do that.
Specifically, my event-1.0.xsd that I referred to earler only created:
package-info.java, ObjectFactory.java, EventType.java, Participant.java.
That's it.


Are you telling it to generate as JAXB1.0-compatible?

Malachi


On 3/13/06, Gertelman, Michael, VF-JP <michael.gertelman_at_vodafone.com>
wrote:
>
>
> I am using JAXB from JWSDP-2.0 and XJC version "2.0-b26-ea3".
> It generates two packages: one for interfaces and one for implementations
> and two ObjectFactory.java files in both packages.
> With the code that you use I can only get access to the ObjectFactory from
> the interfaces package. I don't know how to get the impl ObjectFactory...
>
> Michael
>
>
> -----Original Message-----
> *From:* Malachi de Alfweald [mailto:malachid_at_gmail.com]
> *Sent:* Monday, March 13, 2006 4:31 PM
> *To:* users_at_jaxb.dev.java.net
> *Subject:* Re: XJC Plugin development question
>
> That is the same code I used for mine. Specifically, I did:
>
> for(PackageOutline pOutline : outline.getAllPackageContexts())
> {
> /**
> * For each package, locate the ObjectFactory class
> */
> JDefinedClass objectFactory = pOutline.objectFactory();
> ...
>
> I get more than one PackageOutline. This is because I have multiple
> schemas getting compiled at once and each XSD specifies the package binding
> via:
>
> <xsd:annotation>
> <xsd:appinfo>
> <jaxb:schemaBindings>
> <jaxb:package name="org.eoti.spec.gaea.event"/>
> </jaxb:schemaBindings>
> </xsd:appinfo>
> </xsd:annotation>
>
> Now, each of the PackageOutline's that are returned have the
> .objectFactory() method that returns the ObjectFactory.java for that
> specific schema. I know that it is the correct one, because I am extracting
> the JAXBElement<?> at the bottom of the class for my usage.
>
> I am using JAXB2.... It only generates a minimal set of classes... If you
> are getting both interfaces and implementations, are you running specific
> JAXB2 options, or are you running JAXB1? If you are running JAXB1, do you
> have the option of upgrading to the newer JAXB2?
>
> Malachi
>
>
> On 3/12/06, Gertelman, Michael, VF-JP <michael.gertelman_at_vodafone.com>
> wrote:
> >
> > Hello,
> >
> > I'm trying to inject some code into the ObjectFactory from the impl
> > package.
> > I use the following code in my Plugin's* run* method:
> >
> > for (PackageOutline po : outline.getAllPackageContexts()) {
> > JDefinedClass objectFactory = po.objectFactory();
> > }
> >
> > Actually, Iterator always returns only one PackageOutline - for the
> > interfaces package. My problem is that this* objectFactory* refers to
> > the class in the interfaces package.
> >
> > If I inject any code into this objectFactory it affects only the one
> > from the interfaces package.
> >
> > How can I access the ObjectFactory class from the implementation package
> > ?
> >
> > Thanks,
> > Michael
> >
> >
> >
>
>