axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russell Butek" <>
Subject Re: Rewrite of JavaWriter
Date Thu, 06 Jun 2002 14:03:04 GMT
Silence is assent?

I'll check these changes in sometime today.

Russell Butek

Russell Butek/Austin/IBM@IBMUS on 06/03/2002 10:20:55 AM

Please respond to

Subject:    Rewrite of JavaWriter

My next step in revamping WSDL2Java was rewriting JavaWriter (and
consequently all its subclasses).  Before I commit these changes, I want to
pass them by y'all to make sure I don't break anyone without their
knowledge.  The build still succeeds with these changes.  I'd like to
commit these in the next day or two, so I'd appreciate a quick look-see by
those that are concerned.

Primarily, the changes are:
1. JavaWriter is broken into two abstract classes:  JavaWriter and subclass
JavaClassWriter.  JavaDeployWriter and JavaUndeployWriter extend JavaWriter
directly.  The rest, since they all generate Java classes, extend
JavaClassWriter.  In the old version, JavaDeployWriter and
JavaUndeployWriter did some hokey things to fit into the class model.

2. The constructors are simpler:  JavaWriter(Emitter e),
JavaClassWriter(Emitter e, String filename, String type).  Less has to be
known/calculated in the constructor.  For example:

   old JavaHolderWriter ctor:

   new QName(
   Utils.holder(type, emitter).substring(
   Utils.holder(type, emitter).lastIndexOf('.') + 1)),
   JavaUtils.getMessage("genHolder00"), "holder");

   new JavaHolderWriter ctor:

   super(emitter, Utils.holder(type, emitter), "holder");

3. Most write methods now take a PrintWriter parameter instead of assuming
the superclass has a PrintWriter.  This makes it easy to embed one
generated class inside another (JavaBeanHelperWriter).

4. There is now behaviour on JavaWriter and JavaClassWriter.  This behavior
makes it easier to do piecemeal extensions.

Here's the javadoc for JavaWriter:  (See attached file: JavaWriter.html).
Look particularly at the class comments.

Here's the javadoc for JavaClassWriter:  (See attached file:

Here's the set of changes:  (See attached file: diff).  If anyone cares, I
can zip up the actual code for them.

Russell Butek

View raw message