users@jaxb.java.net

Re: adding a standard header to generated JAXB files

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Thu, 04 Dec 2003 14:01:52 -0500

Greg T Robertson wrote:
>
> We use a standard header for all of our files - this is not a javadoc
> comment - just a plain old comment that contains some CVS tags etc for
> version IDs etc. While there's nothing that says it can not be in a
> javadoc comment - it's typically in a standard comment. Is there a way to
> generate a standard "header" for each of the JAXB generated files. I have
> read the information about <xsd:documentation> but it does not sound like
> what I'm looking for - though if there is a way to use the
> <xsd:documentation> to generate a header it would suffice if it can be in
> the bindings file somehow.
>

The JAXB RI doesn't expose any way of inserting non-javadoc comments in
the generated source code. As you pointed out, the only thing you could
do today is add <jxb:javadoc> customizations to your schema, but this
would be tedious and wouldn't even cause the comment to show up in all
of the source files. For example, none of the *.impl or *.impl.runtime
classes could ever have comments added. I assume you want every single
generated file to contain the comment since you mentioned wanting to add
CVS keyword substitutions. If that's the case, then using <jxb:javadoc>
really isn't going to solve the problem.

> Currently I'm looking at generating the files, then running Jalopy on them
> and recompiling - which is by no means an efficient process.
>

Post-processing seems to be the only option for you.

Thanks,

--Ryan

> Thanks,
>
> Greg T. Robertson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net