|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.axis.wsdl.toJava.JavaWriter
Emitter knows about WSDL writers, one each for PortType, Binding, Service, Definition, Type. But for some of these WSDL types, Wsdl2java generates multiple files. Each of these files has a corresponding writer that extends JavaWriter. So the Java WSDL writers (JavaPortTypeWriter, JavaBindingWriter, etc.) each calls a file writer (JavaStubWriter, JavaSkelWriter, etc.) for each file that that WSDL generates.
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):
Field Summary | |
protected Emitter |
emitter
|
protected String |
type
|
Constructor Summary | |
protected |
JavaWriter(Emitter emitter,
String type)
Constructor. |
Method Summary | |
protected void |
closePrintWriter(PrintWriter pw)
Close the print writer. |
void |
generate()
Generate a file. |
protected abstract String |
getFileName()
This method must be implemented by a subclass. |
protected PrintWriter |
getPrintWriter(String filename)
You should not need to override this method. |
protected boolean |
isFileGenerated(String file)
You should not need to override this method. |
protected void |
registerFile(String file)
You should not need to override this method. |
protected String |
verboseMessage(String file)
Return the string: "Generating |
protected void |
writeComment(PrintWriter pw,
Element element)
Output a documentation element as a Java comment. |
protected abstract void |
writeFileBody(PrintWriter pw)
This method must be implemented by a subclass. |
protected void |
writeFileFooter(PrintWriter pw)
You may want to override this method. |
protected void |
writeFileHeader(PrintWriter pw)
This method is intended to be overridden as necessary to generate file header information. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Emitter emitter
protected String type
Constructor Detail |
protected JavaWriter(Emitter emitter, String type)
Method Detail |
public void generate() throws IOException
IOException
protected abstract String getFileName()
protected boolean isFileGenerated(String file)
protected void registerFile(String file)
protected String verboseMessage(String file)
protected PrintWriter getPrintWriter(String filename) throws IOException
IOException
protected void writeFileHeader(PrintWriter pw) throws IOException
IOException
protected abstract void writeFileBody(PrintWriter pw) throws IOException
IOException
protected void writeFileFooter(PrintWriter pw) throws IOException
IOException
protected void closePrintWriter(PrintWriter pw)
protected void writeComment(PrintWriter pw, Element element)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |