|
|||||||||||
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 org.apache.axis.wsdl.toJava.JavaClassWriter
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. Many of the files generated are .java files, so this abstract class - JavaClassWriter - exists. It extends JavaWriter and adds a bit of Java- relative 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 String |
className
|
protected Namespaces |
namespaces
|
protected String |
packageName
|
Fields inherited from class org.apache.axis.wsdl.toJava.JavaWriter |
emitter, type |
Constructor Summary | |
protected |
JavaClassWriter(Emitter emitter,
String fullClassName,
String type)
Constructor. |
Method Summary | |
protected String |
getClassModifiers()
Return "public ". |
protected String |
getClassName()
Returns the class name. |
protected String |
getClassText()
Return "class ". |
protected String |
getExtendsText()
Returns the appropriate extends clause. |
protected String |
getFileName()
Return the file name as a string of the form: " |
protected String |
getImplementsText()
Returns the appropriate implements clause. |
protected String |
getPackage()
Returns the package name. |
protected void |
registerFile(String file)
You should not need to override this method. |
protected void |
writeFileFooter(PrintWriter pw)
Generate the closing curly brace. |
protected void |
writeFileHeader(PrintWriter pw)
Write a common header, including the package name, the class declaration, and the opening curly brace. |
protected void |
writeHeaderComments(PrintWriter pw)
Write the header comments. |
protected void |
writePackage(PrintWriter pw)
Write the package declaration statement. |
Methods inherited from class org.apache.axis.wsdl.toJava.JavaWriter |
closePrintWriter, generate, getPrintWriter, isFileGenerated, verboseMessage, writeComment, writeFileBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Namespaces namespaces
protected String className
protected String packageName
Constructor Detail |
protected JavaClassWriter(Emitter emitter, String fullClassName, String type)
emitter
- The emitter instancefullClassName
- The fully qualified class name of the class
to be generated.type
- Method Detail |
protected String getFileName()
getFileName
in class JavaWriter
protected void registerFile(String file)
registerFile
in class JavaWriter
protected void writeFileHeader(PrintWriter pw) throws IOException
writeFileHeader
in class JavaWriter
IOException
protected void writeHeaderComments(PrintWriter pw) throws IOException
IOException
protected void writePackage(PrintWriter pw) throws IOException
IOException
protected String getClassModifiers()
protected String getClassText()
protected String getExtendsText()
protected String getImplementsText()
protected String getPackage()
protected String getClassName()
protected void writeFileFooter(PrintWriter pw) throws IOException
writeFileFooter
in class JavaWriter
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |