org.apache.axis2.wsdl.codegen.emitter
Class MultiLanguageClientEmitter

java.lang.Object
  extended byorg.apache.axis2.wsdl.codegen.emitter.MultiLanguageClientEmitter
All Implemented Interfaces:
Emitter
Direct Known Subclasses:
CSharpEmitter, JavaEmitter

public abstract class MultiLanguageClientEmitter
extends Object
implements Emitter


Field Summary
protected  PolicyAttachmentUtil attachmentUtil
           
protected  CodeGenConfiguration configuration
           
protected  org.apache.axis2.wsdl.codegen.emitter.MultiLanguageClientEmitter.InformationHolder infoHolder
          This information holder keeps the necessary information of what to codegen.
protected  TypeMapper mapper
           
protected  URIResolver resolver
           
 
Constructor Summary
protected MultiLanguageClientEmitter()
           
 
Method Summary
protected  void addAttribute(Document document, String AttribName, String attribValue, Element element)
          Utility method to add an attribute to a given element.
protected  Element addElement(Document document, String eltName, String eltValue, Element element)
          Utility method to add an attribute to a given element.
protected  void addEndpoint(Document doc, Element rootElement)
          Adds the endpoint to the document.
protected  void addSoapVersion(org.apache.wsdl.WSDLBinding binding, Document doc, Element rootElement)
          Looks for the SOAPVersion and adds it.
protected  Document createDocumentForMessageReceiver(String mep)
           
protected  Document createDOMDocumentForAntBuild()
          Creates the DOM tree for the Ant build.
protected  Document createDOMDocumentForCallbackHandler()
          Generates the model for the callbacks.
protected  Document createDOMDocumentForInterface(boolean writeDatabinders)
          Creates the DOM tree for the interface creation.
protected  Document createDOMDocumentForInterfaceImplementation()
          Creates the DOM tree for implementations.
protected  Document createDOMDocumentForServiceXML()
           
protected  Document createDOMDocumentForSkeleton()
          Creates the model for the skeleton.
protected  Document createDOMDocumentForTestCase()
           
protected  Element createDOMElementforDatabinders(Document doc, org.apache.wsdl.WSDLBinding binding)
           
 void emitSkeleton()
           
 void emitStub()
           
protected  Element getInputElement(Document doc, org.apache.wsdl.WSDLOperation operation, List headerParameterQNameList)
          Finds the input element for the xml document.
protected  File getOutputDirectory(File outputDir, String dir2)
          Gets the output directory for source files.
protected  Element getOutputElement(Document doc, org.apache.wsdl.WSDLOperation operation, List headerParameterQNameList)
          Finds the output element.
protected  String makeJavaClassName(String word)
           
 void setCodeGenConfiguration(CodeGenConfiguration configuration)
          Sets the code generator configuration.
 void setMapper(TypeMapper mapper)
          Sets the mapper.
protected  void writeAntBuild()
          Writes the Ant build.
protected  void writeCallBackHandlers()
          Writes the callback handlers.
protected  void writeClass(Document model, ClassWriter writer)
          A resusable method for the implementation of interface and implementation writing.
protected  void writeInterface(boolean writeDatabinders)
          Writes the interfaces.
protected  void writeInterfaceImplementation()
          Writes the implementations.
protected  void writeMessageReceiver()
           
protected  void writeServiceXml()
          Writes the Service XML.
protected  void writeSkeleton()
          Writes the skeleton.
protected  void writeTestClasses()
          Write the test classes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

infoHolder

protected org.apache.axis2.wsdl.codegen.emitter.MultiLanguageClientEmitter.InformationHolder infoHolder
This information holder keeps the necessary information of what to codegen. The service, port, binding (and the WSDLinterface) if the service and binding tags are missing then only the portype wil be there This will get populated before executing any code generation


configuration

protected CodeGenConfiguration configuration

mapper

protected TypeMapper mapper

resolver

protected URIResolver resolver

attachmentUtil

protected PolicyAttachmentUtil attachmentUtil
Constructor Detail

MultiLanguageClientEmitter

protected MultiLanguageClientEmitter()
Method Detail

addAttribute

protected void addAttribute(Document document,
                            String AttribName,
                            String attribValue,
                            Element element)
Utility method to add an attribute to a given element.

Parameters:
document -
AttribName -
attribValue -
element -

addElement

protected Element addElement(Document document,
                             String eltName,
                             String eltValue,
                             Element element)
Utility method to add an attribute to a given element.

Parameters:
document -
eltName -
eltValue -
element -

addEndpoint

protected void addEndpoint(Document doc,
                           Element rootElement)
                    throws Exception
Adds the endpoint to the document.

Parameters:
doc -
rootElement -
Throws:
Exception

addSoapVersion

protected void addSoapVersion(org.apache.wsdl.WSDLBinding binding,
                              Document doc,
                              Element rootElement)
Looks for the SOAPVersion and adds it.

Parameters:
binding -
doc -
rootElement -

createDOMDocumentForAntBuild

protected Document createDOMDocumentForAntBuild()
Creates the DOM tree for the Ant build. Uses the interface.


createDOMDocumentForCallbackHandler

protected Document createDOMDocumentForCallbackHandler()
Generates the model for the callbacks.


createDOMDocumentForInterface

protected Document createDOMDocumentForInterface(boolean writeDatabinders)
Creates the DOM tree for the interface creation. Uses the interface.


createDOMDocumentForInterfaceImplementation

protected Document createDOMDocumentForInterfaceImplementation()
                                                        throws Exception
Creates the DOM tree for implementations.

Throws:
Exception

createDOMDocumentForServiceXML

protected Document createDOMDocumentForServiceXML()

createDOMDocumentForSkeleton

protected Document createDOMDocumentForSkeleton()
Creates the model for the skeleton.

Returns:
Returns documentModel for the skeleton.

createDOMDocumentForTestCase

protected Document createDOMDocumentForTestCase()

createDOMElementforDatabinders

protected Element createDOMElementforDatabinders(Document doc,
                                                 org.apache.wsdl.WSDLBinding binding)

createDocumentForMessageReceiver

protected Document createDocumentForMessageReceiver(String mep)

emitSkeleton

public void emitSkeleton()
                  throws CodeGenerationException
Specified by:
emitSkeleton in interface Emitter
Throws:
CodeGenerationException
See Also:
Emitter.emitSkeleton()

emitStub

public void emitStub()
              throws CodeGenerationException
Specified by:
emitStub in interface Emitter
Throws:
CodeGenerationException
See Also:
Emitter.emitStub()

makeJavaClassName

protected String makeJavaClassName(String word)
Parameters:
word -
Returns:
Returns character removed string.

writeAntBuild

protected void writeAntBuild()
                      throws Exception
Writes the Ant build.

Throws:
Exception

writeCallBackHandlers

protected void writeCallBackHandlers()
                              throws Exception
Writes the callback handlers.

Throws:
Exception

writeClass

protected void writeClass(Document model,
                          ClassWriter writer)
                   throws IOException,
                          Exception
A resusable method for the implementation of interface and implementation writing.

Parameters:
model -
writer -
Throws:
IOException
Exception

writeInterface

protected void writeInterface(boolean writeDatabinders)
                       throws Exception
Writes the interfaces.

Throws:
Exception

writeInterfaceImplementation

protected void writeInterfaceImplementation()
                                     throws Exception
Writes the implementations.

Throws:
Exception

writeMessageReceiver

protected void writeMessageReceiver()
                             throws Exception
Throws:
Exception

writeServiceXml

protected void writeServiceXml()
                        throws Exception
Writes the Service XML.

Throws:
Exception

writeSkeleton

protected void writeSkeleton()
                      throws Exception
Writes the skeleton.

Throws:
Exception

writeTestClasses

protected void writeTestClasses()
                         throws Exception
Write the test classes

Throws:
Exception

getInputElement

protected Element getInputElement(Document doc,
                                  org.apache.wsdl.WSDLOperation operation,
                                  List headerParameterQNameList)
Finds the input element for the xml document.

Parameters:
doc -
operation -
headerParameterQNameList -

getOutputDirectory

protected File getOutputDirectory(File outputDir,
                                  String dir2)
Gets the output directory for source files.

Parameters:
outputDir -
Returns:
Returns File.

getOutputElement

protected Element getOutputElement(Document doc,
                                   org.apache.wsdl.WSDLOperation operation,
                                   List headerParameterQNameList)
Finds the output element.

Parameters:
doc -
operation -
headerParameterQNameList -

setCodeGenConfiguration

public void setCodeGenConfiguration(CodeGenConfiguration configuration)
Sets the code generator configuration. This needs to be called before asking to codegen

Specified by:
setCodeGenConfiguration in interface Emitter
Parameters:
configuration -

setMapper

public void setMapper(TypeMapper mapper)
Sets the mapper.

Specified by:
setMapper in interface Emitter
Parameters:
mapper -
See Also:
TypeMapper