Class AxisServiceBasedMultiLanguageEmitter

java.lang.Object
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter
All Implemented Interfaces:
Emitter
Direct Known Subclasses:
CEmitter, JavaEmitter, JAXWSEmitter

public class AxisServiceBasedMultiLanguageEmitter extends Object implements Emitter
  • Field Details

    • CALL_BACK_HANDLER_SUFFIX

      protected static final String CALL_BACK_HANDLER_SUFFIX
      See Also:
    • STUB_SUFFIX

      protected static final String STUB_SUFFIX
      See Also:
    • TEST_SUFFIX

      protected static final String TEST_SUFFIX
      See Also:
    • SKELETON_CLASS_SUFFIX

      protected static final String SKELETON_CLASS_SUFFIX
      See Also:
    • SKELETON_CLASS_SUFFIX_BACK

      protected static final String SKELETON_CLASS_SUFFIX_BACK
      See Also:
    • SKELETON_INTERFACE_SUFFIX

      protected static final String SKELETON_INTERFACE_SUFFIX
      See Also:
    • SKELETON_INTERFACE_SUFFIX_BACK

      protected static final String SKELETON_INTERFACE_SUFFIX_BACK
      See Also:
    • STUB_INTERFACE_SUFFIX_BACK

      protected static final String STUB_INTERFACE_SUFFIX_BACK
      See Also:
    • MESSAGE_RECEIVER_SUFFIX

      protected static final String MESSAGE_RECEIVER_SUFFIX
      See Also:
    • DATABINDING_SUPPORTER_NAME_SUFFIX

      protected static final String DATABINDING_SUPPORTER_NAME_SUFFIX
      See Also:
    • mepToClassMap

      protected static final Map mepToClassMap
    • mepToSuffixMap

      protected static final Map mepToSuffixMap
    • axisBinding

      protected org.apache.axis2.description.AxisBinding axisBinding
    • axisEndpoint

      protected org.apache.axis2.description.AxisEndpoint axisEndpoint
    • uniqueFaultNameCounter

      protected int uniqueFaultNameCounter
    • constructorMap

      protected static final HashMap constructorMap
      Field constructorMap
    • log

      protected static final org.apache.commons.logging.Log log
    • resolver

      protected URIResolver resolver
    • infoHolder

      protected Map infoHolder
    • allServiceInfoHolder

      protected Map allServiceInfoHolder
    • codeGenConfiguration

      protected CodeGenConfiguration codeGenConfiguration
    • mapper

      protected TypeMapper mapper
    • axisService

      protected org.apache.axis2.description.AxisService axisService
    • axisServices

      protected List axisServices
    • fullyQualifiedFaultClassNameMap

      protected Map fullyQualifiedFaultClassNameMap
    • faultClassNameMap

      protected Map faultClassNameMap
    • faultElementQNameMap

      protected Map faultElementQNameMap
    • instantiatableMessageClassNames

      protected Map instantiatableMessageClassNames
    • TEST_SRC_DIR_NAME

      protected static final String TEST_SRC_DIR_NAME
      See Also:
    • useHolderClass_jaxws

      protected boolean useHolderClass_jaxws
    • wrapped_jaxws

      protected boolean wrapped_jaxws
  • Constructor Details

    • AxisServiceBasedMultiLanguageEmitter

      public AxisServiceBasedMultiLanguageEmitter()
      default constructor - builds
  • Method Details

    • setCodeGenConfiguration

      public void setCodeGenConfiguration(CodeGenConfiguration configuration)
      Sets the relevant codegen configuration
      Specified by:
      setCodeGenConfiguration in interface Emitter
      Parameters:
      configuration -
      See Also:
    • setMapper

      public void setMapper(TypeMapper mapper)
      Sets the type mapper
      Specified by:
      setMapper in interface Emitter
      Parameters:
      mapper -
      See Also:
    • getBindingPropertyFromOperation

      protected Object getBindingPropertyFromOperation(String name, QName qName)
    • getBindingPolicyFromMessage

      protected org.apache.neethi.Policy getBindingPolicyFromMessage(org.apache.axis2.description.AxisBindingOperation axisBindingOperation, String key)
    • getBindingPropertyFromMessage

      protected Object getBindingPropertyFromMessage(String name, QName qName, String key)
    • getBindingPropertyFromMessageFault

      protected Object getBindingPropertyFromMessageFault(String name, QName qName, String key)
    • updateMapperForStub

      protected void updateMapperForStub()
      Update mapper for the stub
    • getFullyQualifiedStubName

      protected String getFullyQualifiedStubName()
      Returns the fully qualified Stub name reused in many methods
      Returns:
      classname
    • resetFaultNames

      protected void resetFaultNames()
      rests the fault name maps
    • generateAndPopulateFaultNames

      protected void generateAndPopulateFaultNames()
      Populate a map of fault class names
    • emitStub

      public void emitStub() throws CodeGenerationException
      Emits the stubcode with bindings.
      Specified by:
      emitStub in interface Emitter
      Throws:
      CodeGenerationException
      See Also:
    • getNewCopy

      public Map getNewCopy(Map copyFormMap)
    • copyMap

      public void copyMap(Map copyFormMap, Map copyToMap)
    • writeAntBuild

      protected void writeAntBuild() throws Exception
      Writes the Ant build.
      Throws:
      Exception
    • createDOMDocumentForAntBuild

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

      protected void writeTestClasses() throws Exception
      Write the test classes
      Throws:
      Exception
    • createDOMDocumentForTestCase

      protected Document createDOMDocumentForTestCase()
      Creates the XML Model for the test case
      Returns:
      DOM document
    • writeInterfaceImplementation

      protected void writeInterfaceImplementation() throws Exception
      Writes the implementations.
      Throws:
      Exception
    • createDOMDocumentForInterfaceImplementation

      protected Document createDOMDocumentForInterfaceImplementation() throws Exception
      Creates the DOM tree for implementations.
      Throws:
      Exception
    • getUniqueListofFaults

      protected Element getUniqueListofFaults(Document doc)
      A util method that returns a unique list of faults
      Parameters:
      doc -
      Returns:
      DOM element
    • addFaultMessages

      protected void addFaultMessages(List operationFaultMessages, Set faultMessagesToMep)
      add the qNames of the operation fault message names to faultMessages Mep
      Parameters:
      operationFaultMessages -
      faultMessagesToMep -
    • getUniqueListofFaultsofMep

      protected Element getUniqueListofFaultsofMep(Document doc, String mep)
      A util method that returns a unique list of faults for a given mep
      Parameters:
      doc -
      Returns:
      DOM 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(Document doc, Element rootElement)
      Looks for the SOAPVersion and adds it.
      Parameters:
      doc -
      rootElement -
    • writeExceptions

      protected void writeExceptions() throws Exception
      Writes the exceptions.
      Throws:
      Exception
    • createDOMDocumentForException

      protected Document createDOMDocumentForException()
      Generates the model for the callbacks.
    • writeCallBackHandlers

      protected void writeCallBackHandlers() throws Exception
      Writes the callback handlers.
      Throws:
      Exception
    • createDOMDocumentForCallbackHandler

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

      protected void writeInterface(boolean writeDatabinders) throws Exception
      Writes the interfaces.
      Throws:
      Exception
    • createDOMDocumentForInterface

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

      protected void updateMapperForMessageReceiver()
      Update mapper for message receiver
    • getFullyQualifiedMessageReceiverName

      protected String getFullyQualifiedMessageReceiverName()
      Returns:
      fully qualified MR name
    • getFullyQualifiedSkeletonName

      protected String getFullyQualifiedSkeletonName()
      Returns:
      fully qualified skeleton name
    • getFullyQualifiedSkeletonInterfaceName

      protected String getFullyQualifiedSkeletonInterfaceName()
      Returns:
      fully qualified skeleton interface name
    • emitSkeleton

      public void emitSkeleton() throws CodeGenerationException
      Emits the skeleton
      Specified by:
      emitSkeleton in interface Emitter
      Throws:
      CodeGenerationException
    • writeWSDLFiles

      protected void writeWSDLFiles()
      Write out the WSDL files (and the schemas) writing the WSDL (and schemas) is somewhat special so we cannot follow the usual pattern of using the class writer
    • copyToFaultMap

      protected void copyToFaultMap()
      Utility method to copy the faults to the correct map
    • updateFaultPackageForStub

      protected void updateFaultPackageForStub()
      Change the fault classnames to go with the package and stub
    • writeMessageReceiver

      protected void writeMessageReceiver() throws Exception
      Writes the message receiver
      Throws:
      Exception
    • createDocumentForMessageReceiver

      protected Document createDocumentForMessageReceiver(String mep, boolean isServerSideInterface)
      Creates the XML model for the message receiver
      Parameters:
      mep -
      isServerSideInterface -
      Returns:
      DOM Document
    • createDOMElementforDatabinders

      protected Element createDOMElementforDatabinders(Document doc, boolean isServerside)
      create a dom element for databinders. This is called by other
      Parameters:
      doc -
    • addShortType

      protected void addShortType(Element paramElement, String xmlName)
      set the short type as it is in the data binding
      Parameters:
      paramElement -
      xmlName -
    • getOpNames

      protected Element getOpNames(Document doc)
      Gets an element representing the operation names
      Parameters:
      doc -
      Returns:
      Returns Element.
    • getBase64Elements

      protected Element getBase64Elements(Document doc)
      Gets the base64 types. If not available this will be empty!!!
      Parameters:
      doc -
      Returns:
      Returns Element.
    • processModelObjects

      protected void processModelObjects(Map objectMappings, Element root, Document doc)
      Parameters:
      objectMappings -
      root -
      doc -
    • updateMapperClassnames

      protected void updateMapperClassnames(String fullyQulifiedIncludingClassNamePrefix)
      we need to modify the mapper's class name list. The issue here is that in this case we do not expect the fully qulified class names to be present in the class names list due to the simple reason that they've not been written yet! Hence the mappers class name list needs to be updated to suit the expected package to be written in this case we modify the package name to have the class a inner class of the stub, interface or the message receiver depending on the style
    • writeServiceXml

      protected void writeServiceXml() throws Exception
      Write the service XML
      Throws:
      Exception
    • createDOMDocumentForServiceXML

      protected Document createDOMDocumentForServiceXML()
    • getServiceElement

      protected Element getServiceElement(String serviceName, String className, Document doc)
      A resusable method to return the service element for creating the service xml
      Parameters:
      serviceName -
      className -
      doc -
      Returns:
      DOM Element
    • writeSkeleton

      protected void writeSkeleton() throws Exception
      Throws:
      Exception
    • writeSkeletonInterface

      protected void writeSkeletonInterface() throws Exception
      Write the skeletonInterface
      Throws:
      Exception
    • createDOMDocumentForSkeleton

      protected Document createDOMDocumentForSkeleton(boolean isSkeletonInterface)
      Creates the XMLModel for the skeleton
      Parameters:
      isSkeletonInterface -
      Returns:
      DOM Document
    • createDOMDocumentForSkeletonInterface

      protected Document createDOMDocumentForSkeletonInterface()
      Creates the XML model for the skeleton interface
      Returns:
      DOM Document
    • loadOperations

      protected boolean loadOperations(Document doc, Element rootElement, String mep)
      Loads the operations
      Parameters:
      doc -
      rootElement -
      mep -
      Returns:
      boolean
    • generateMethodElement

      protected Element generateMethodElement(Document doc, String endpointName, org.apache.axis2.description.AxisBindingOperation bindingOperation) throws DOMException
      Common code to generate a element from an operation.
      Parameters:
      doc -
      endpointName -
      bindingOperation -
      Returns:
      generated element
      Throws:
      DOMException
    • getEmptyDocument

      protected Document getEmptyDocument()
    • makeJavaClassName

      protected String makeJavaClassName(String word)
      Parameters:
      word -
      Returns:
      Returns character removed string.
    • 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 -
    • fillSyncAttributes

      protected void fillSyncAttributes(Document doc, Element rootElement)
      Parameters:
      doc -
      rootElement -
    • debugLogDocument

      protected void debugLogDocument(String description, Document doc)
      debugging method - write the output to the debugger
      Parameters:
      description -
      doc -
    • getOutputDirectory

      protected File getOutputDirectory(File outputDir, String dir2)
      Gets the output directory for source files.
      Parameters:
      outputDir -
      Returns:
      Returns File.
    • writeFile

      protected void writeFile(Document model, FileWriter writer) throws IOException, Exception
      A resusable method for the implementation of interface and implementation writing.
      Parameters:
      model -
      writer -
      Throws:
      IOException
      Exception
    • addSOAPAction

      protected void addSOAPAction(Document doc, Element rootElement, QName qName)
      Adds the soap action
      Parameters:
      doc -
      rootElement -
      qName -
    • addHeaderOperations

      protected void addHeaderOperations(List soapHeaderParameterQNameList, org.apache.axis2.description.AxisBindingOperation bindingOperation, boolean input)
      populate the header parameters
      Parameters:
      soapHeaderParameterQNameList -
      bindingOperation -
      input -
    • addHeaderOperationsToFault

      protected void addHeaderOperationsToFault(List soapHeaderParameterQNameList, org.apache.axis2.description.AxisOperation axisOperation)
      populate the header parameters to faults
      Parameters:
      soapHeaderParameterQNameList -
      axisOperation -
    • getInputElement

      protected Element getInputElement(Document doc, org.apache.axis2.description.AxisBindingOperation bindingOperation, List headerParameterQNameList)
      Get the input element
      Parameters:
      doc -
      bindingOperation -
      headerParameterQNameList -
      Returns:
      DOM element
    • getFaultElement

      protected Element getFaultElement(Document doc, org.apache.axis2.description.AxisOperation operation)
      Get the fault element - No header faults are supported
      Parameters:
      doc -
      operation -
    • getOutputElement

      protected Element getOutputElement(Document doc, org.apache.axis2.description.AxisBindingOperation bindingOperation, List headerParameterQNameList)
      Finds the output element.
      Parameters:
      doc -
      bindingOperation -
      headerParameterQNameList -
    • getFaultParamElements

      protected Element[] getFaultParamElements(Document doc, org.apache.axis2.description.AxisOperation operation)
      Parameters:
      doc -
      operation -
      Returns:
      Returns the parameter element.
    • getInputParamElement

      protected Element[] getInputParamElement(Document doc, org.apache.axis2.description.AxisOperation operation)
      Parameters:
      doc -
      operation -
      Returns:
      Returns the parameter element.
    • generateParamComponent

      protected Element generateParamComponent(Document doc, String comment, String paramName, String paramType, QName operationName, QName paramQName)
      A convenient method for the generating the parameter element
      Parameters:
      doc -
      paramName -
      paramType -
      Returns:
      DOM Element
    • generateParamComponent

      protected Element generateParamComponent(Document doc, String comment, String paramName, String paramType, QName paramQName)
      A convenient method for the generating the parameter element
      Parameters:
      doc -
      paramName -
      paramType -
      Returns:
      DOM Element
    • generateOptionParamComponent

      protected Element generateOptionParamComponent(Document doc, String name, String value)
      A convenient method for the generating optionParam components
      Parameters:
      doc -
      name -
      value -
      Returns:
      Element
    • generateParamComponent

      protected Element generateParamComponent(Document doc, String comment, String paramName, String paramType, QName opName, QName paramQName, String partName, boolean isPrimitive, boolean isArray)
      A convenient method for the generating the parameter element
      Parameters:
      doc -
      paramName -
      paramType -
      opName -
      paramName -
    • getOutputParamElement

      protected Element getOutputParamElement(Document doc, org.apache.axis2.description.AxisOperation operation)
      Parameters:
      doc -
      operation -
      Returns:
      Returns Element.
    • getParamInitializer

      protected String getParamInitializer(String paramType)
      Parameters:
      paramType -
    • getParameterElementList

      protected List getParameterElementList(Document doc, List parameters, String location)
      Parameters:
      doc -
      parameters -
      location -
    • getParameterElementListForHttpHeader

      protected List getParameterElementListForHttpHeader(Document doc, List parameters, String location)
    • getParameterElementListForSOAPModules

      protected List getParameterElementListForSOAPModules(Document doc, List parameters)
    • 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 -