users@jaxb.java.net

Re: A question on XjcListener and JAXB 2.0 file generator

From: Kirill Grouchnikov <kirillcool_at_yahoo.com>
Date: Mon, 20 Mar 2006 07:30:44 -0800 (PST)

Kohsuke,

With XjcListener running on FPML schemas i get "parsing model" message and after 1-2 seconds i start getting generatedFile events for about 10 seconds. So, i'd say that it's quite useful as for large schemas the number of generated files causes the second stage (the generation itself) to be more lengthy than the schema parsing.

In any case it's not the linear progress, but it's better than a progress dialog with no progress bar.

If it can be done before the final release, it would be very helpful (not only for IDE plugins). Perhaps a new method in XjcListener - void generatedFile(String filename, int fileNumber, int totalFileCount), or a subclass of XjcListener and then check if it's a subclass - to not call the old generatedFile function. Or even change the signature of generatedFile since it's still not official release.

Kirill

Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM> wrote: Kirill Grouchnikov wrote:
> Hi,
>
> Is there any way to know the number of generated files in advance?
> It would be very useful to show a progress status in IDE-based plugins.
> If so, is it not too late to add such function to XjcListener - a new

You only know this at a relatively late stage of the compilation ---
when you got a fully populated JCodeModel, you can compute a number of
the generated classes from there.

That's almost all the way to the end of the compilation, as then the
only thing left to do is to actually write them out, which probably
isn't taking a significant time.

Given those, do you think it's still worth it? If so, I can try.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze.