org.apache.axis.wsdl.toJava
public abstract class JavaWriter extends java.lang.Object implements Generator
For example, when Emitter calls JavaWriterFactory for a Binding Writer, it returns a JavaBindingWriter. JavaBindingWriter, in turn, contains a JavaStubWriter, JavaSkelWriter, and JavaImplWriter since a Binding may cause a stub, skeleton, and impl template to be generated.
Note that the writers that are given to Emitter by JavaWriterFactory DO NOT extend JavaWriter. They simply implement Writer and delegate the actual task of writing to extensions of JavaWriter.
All of Wsdl2java's Writer implementations follow a common behaviour. JavaWriter is the abstract base class that dictates this common behaviour. This behaviour is primarily placed within the generate method. The generate method calls, in succession (note: the starred methods are the ones you are probably most interested in):
Modifier and Type | Field and Description |
---|---|
protected Emitter |
emitter
Field emitter
|
protected static int |
LINE_LENGTH
This controls how many characters per line for javadoc comments
|
protected java.lang.String |
type
Field type
|
Modifier | Constructor and Description |
---|---|
protected |
JavaWriter(Emitter emitter,
java.lang.String type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closePrintWriter(java.io.PrintWriter pw)
Close the print writer.
|
void |
generate()
Generate a file.
|
protected abstract java.lang.String |
getFileName()
This method must be implemented by a subclass.
|
protected java.lang.String |
getJavadocDescriptionPart(java.lang.String documentation,
boolean addTab)
Takes out new lines and wraps at Javadoc tags
|
protected java.io.PrintWriter |
getPrintWriter(java.lang.String filename)
You should not need to override this method.
|
protected boolean |
isFileGenerated(java.lang.String file)
You should not need to override this method.
|
protected void |
registerFile(java.lang.String file)
You should not need to override this method.
|
protected java.lang.String |
verboseMessage(java.lang.String file)
Return the string: "Generating
|
protected void |
writeComment(java.io.PrintWriter pw,
org.w3c.dom.Element element)
Output a documentation element as a Java comment.
|
protected void |
writeComment(java.io.PrintWriter pw,
org.w3c.dom.Element element,
boolean addTab)
Output a documentation element as a Java comment.
|
protected abstract void |
writeFileBody(java.io.PrintWriter pw)
This method must be implemented by a subclass.
|
protected void |
writeFileFooter(java.io.PrintWriter pw)
You may want to override this method.
|
protected void |
writeFileHeader(java.io.PrintWriter pw)
This method is intended to be overridden as necessary
to generate file header information.
|
protected static final int LINE_LENGTH
protected Emitter emitter
protected java.lang.String type
protected JavaWriter(Emitter emitter, java.lang.String type)
emitter
- type
- public void generate() throws java.io.IOException
protected abstract java.lang.String getFileName()
protected boolean isFileGenerated(java.lang.String file)
file
- protected void registerFile(java.lang.String file)
file
- protected java.lang.String verboseMessage(java.lang.String file)
file
- protected java.io.PrintWriter getPrintWriter(java.lang.String filename) throws java.io.IOException
filename
- java.io.IOException
protected void writeFileHeader(java.io.PrintWriter pw) throws java.io.IOException
pw
- java.io.IOException
protected abstract void writeFileBody(java.io.PrintWriter pw) throws java.io.IOException
pw
- java.io.IOException
protected void writeFileFooter(java.io.PrintWriter pw) throws java.io.IOException
pw
- java.io.IOException
protected void closePrintWriter(java.io.PrintWriter pw)
pw
- protected java.lang.String getJavadocDescriptionPart(java.lang.String documentation, boolean addTab)
documentation
- the raw comments from schemaaddTab
- if true adds a tab character when wrapping (methods)protected void writeComment(java.io.PrintWriter pw, org.w3c.dom.Element element)
pw
- element
- protected void writeComment(java.io.PrintWriter pw, org.w3c.dom.Element element, boolean addTab)
pw
- element
- addTab
- Copyright ? 2005 Apache Web Services Project. All Rights Reserved.