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 Summary
-
Constructor Summary
Constructors Constructor Description AxisServiceBasedMultiLanguageEmitter()
default constructor - builds
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
addFaultMessages(List operationFaultMessages, Set faultMessagesToMep)
add the qNames of the operation fault message names to faultMessages Mepprotected void
addHeaderOperations(List soapHeaderParameterQNameList, AxisBindingOperation bindingOperation, boolean input)
populate the header parametersprotected void
addHeaderOperationsToFault(List soapHeaderParameterQNameList, AxisOperation axisOperation)
populate the header parameters to faultsprotected void
addShortType(Element paramElement, String xmlName)
set the short type as it is in the data bindingprotected void
addSOAPAction(Document doc, Element rootElement, QName qName)
Adds the soap actionprotected void
addSoapVersion(Document doc, Element rootElement)
Looks for the SOAPVersion and adds it.void
copyMap(Map copyFormMap, Map copyToMap)
protected void
copyToFaultMap()
Utility method to copy the faults to the correct mapprotected Document
createDocumentForMessageReceiver(String mep, boolean isServerSideInterface)
Creates the XML model for the message receiverprotected Document
createDOMDocumentForAntBuild()
Creates the DOM tree for the Ant build.protected Document
createDOMDocumentForCallbackHandler()
Generates the model for the callbacks.protected Document
createDOMDocumentForException()
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(boolean isSkeletonInterface)
Creates the XMLModel for the skeletonprotected Document
createDOMDocumentForSkeletonInterface()
Creates the XML model for the skeleton interfaceprotected Document
createDOMDocumentForTestCase()
Creates the XML Model for the test caseprotected Element
createDOMElementforDatabinders(Document doc, boolean isServerside)
create a dom element for databinders.protected void
debugLogDocument(String description, Document doc)
debugging method - write the output to the debuggervoid
emitSkeleton()
Emits the skeletonvoid
emitStub()
Emits the stubcode with bindings.protected void
fillSyncAttributes(Document doc, Element rootElement)
protected void
generateAndPopulateFaultNames()
Populate a map of fault class namesprotected Element
generateMethodElement(Document doc, String endpointName, AxisBindingOperation bindingOperation)
Common code to generate aelement from an operation. protected Element
generateOptionParamComponent(Document doc, String name, String value)
A convenient method for the generating optionParam componentsprotected Element
generateParamComponent(Document doc, String comment, String paramName, String paramType, QName paramQName)
A convenient method for the generating the parameter elementprotected Element
generateParamComponent(Document doc, String comment, String paramName, String paramType, QName operationName, QName paramQName)
A convenient method for the generating the parameter elementprotected 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 elementprotected Element
getBase64Elements(Document doc)
Gets the base64 types.protected org.apache.neethi.Policy
getBindingPolicyFromMessage(AxisBindingOperation axisBindingOperation, String key)
protected Object
getBindingPropertyFromMessage(String name, QName qName, String key)
protected Object
getBindingPropertyFromMessageFault(String name, QName qName, String key)
protected Object
getBindingPropertyFromOperation(String name, QName qName)
protected Document
getEmptyDocument()
protected Element
getFaultElement(Document doc, AxisOperation operation)
Get the fault element - No header faults are supportedprotected Element[]
getFaultParamElements(Document doc, AxisOperation operation)
protected String
getFullyQualifiedMessageReceiverName()
protected String
getFullyQualifiedSkeletonInterfaceName()
protected String
getFullyQualifiedSkeletonName()
protected String
getFullyQualifiedStubName()
Returns the fully qualified Stub name reused in many methodsprotected Element
getInputElement(Document doc, AxisBindingOperation bindingOperation, List headerParameterQNameList)
Get the input elementprotected Element[]
getInputParamElement(Document doc, AxisOperation operation)
Map
getNewCopy(Map copyFormMap)
protected Element
getOpNames(Document doc)
Gets an element representing the operation namesprotected File
getOutputDirectory(File outputDir, String dir2)
Gets the output directory for source files.protected Element
getOutputElement(Document doc, AxisBindingOperation bindingOperation, List headerParameterQNameList)
Finds the output element.protected Element
getOutputParamElement(Document doc, AxisOperation operation)
protected List
getParameterElementList(Document doc, List parameters, String location)
protected List
getParameterElementListForHttpHeader(Document doc, List parameters, String location)
protected List
getParameterElementListForSOAPModules(Document doc, List parameters)
protected String
getParamInitializer(String paramType)
protected Element
getServiceElement(String serviceName, String className, Document doc)
A resusable method to return the service element for creating the service xmlprotected Element
getUniqueListofFaults(Document doc)
A util method that returns a unique list of faultsprotected Element
getUniqueListofFaultsofMep(Document doc, String mep)
A util method that returns a unique list of faults for a given mepprotected boolean
loadOperations(Document doc, Element rootElement, String mep)
Loads the operationsprotected String
makeJavaClassName(String word)
protected void
processModelObjects(Map objectMappings, Element root, Document doc)
protected void
resetFaultNames()
rests the fault name mapsvoid
setCodeGenConfiguration(CodeGenConfiguration configuration)
Sets the relevant codegen configurationvoid
setMapper(TypeMapper mapper)
Sets the type mapperprotected void
updateFaultPackageForStub()
Change the fault classnames to go with the package and stubprotected void
updateMapperClassnames(String fullyQulifiedIncludingClassNamePrefix)
we need to modify the mapper's class name list.protected void
updateMapperForMessageReceiver()
Update mapper for message receiverprotected void
updateMapperForStub()
Update mapper for the stubprotected void
writeAntBuild()
Writes the Ant build.protected void
writeCallBackHandlers()
Writes the callback handlers.protected void
writeExceptions()
Writes the exceptions.protected void
writeFile(Document model, FileWriter 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()
Writes the message receiverprotected void
writeServiceXml()
Write the service XMLprotected void
writeSkeleton()
protected void
writeSkeletonInterface()
Write the skeletonInterfaceprotected void
writeTestClasses()
Write the test classesprotected 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
-
-
-
Field Detail
-
CALL_BACK_HANDLER_SUFFIX
protected static final String CALL_BACK_HANDLER_SUFFIX
- See Also:
- Constant Field Values
-
STUB_SUFFIX
protected static final String STUB_SUFFIX
- See Also:
- Constant Field Values
-
TEST_SUFFIX
protected static final String TEST_SUFFIX
- See Also:
- Constant Field Values
-
SKELETON_CLASS_SUFFIX
protected static final String SKELETON_CLASS_SUFFIX
- See Also:
- Constant Field Values
-
SKELETON_CLASS_SUFFIX_BACK
protected static final String SKELETON_CLASS_SUFFIX_BACK
- See Also:
- Constant Field Values
-
SKELETON_INTERFACE_SUFFIX
protected static final String SKELETON_INTERFACE_SUFFIX
- See Also:
- Constant Field Values
-
SKELETON_INTERFACE_SUFFIX_BACK
protected static final String SKELETON_INTERFACE_SUFFIX_BACK
- See Also:
- Constant Field Values
-
STUB_INTERFACE_SUFFIX_BACK
protected static final String STUB_INTERFACE_SUFFIX_BACK
- See Also:
- Constant Field Values
-
MESSAGE_RECEIVER_SUFFIX
protected static final String MESSAGE_RECEIVER_SUFFIX
- See Also:
- Constant Field Values
-
DATABINDING_SUPPORTER_NAME_SUFFIX
protected static final String DATABINDING_SUPPORTER_NAME_SUFFIX
- See Also:
- Constant Field Values
-
mepToClassMap
protected static final Map mepToClassMap
-
mepToSuffixMap
protected static final Map mepToSuffixMap
-
axisBinding
protected AxisBinding axisBinding
-
axisEndpoint
protected 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 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:
- Constant Field Values
-
useHolderClass_jaxws
protected boolean useHolderClass_jaxws
-
wrapped_jaxws
protected boolean wrapped_jaxws
-
-
Method Detail
-
setCodeGenConfiguration
public void setCodeGenConfiguration(CodeGenConfiguration configuration)
Sets the relevant codegen configuration- Specified by:
setCodeGenConfiguration
in interfaceEmitter
- Parameters:
configuration
-- See Also:
Emitter.setCodeGenConfiguration(org.apache.axis2.wsdl.codegen.CodeGenConfiguration)
-
setMapper
public void setMapper(TypeMapper mapper)
Sets the type mapper- Specified by:
setMapper
in interfaceEmitter
- Parameters:
mapper
-- See Also:
Emitter.setMapper(org.apache.axis2.wsdl.databinding.TypeMapper)
-
getBindingPropertyFromOperation
protected Object getBindingPropertyFromOperation(String name, QName qName)
-
getBindingPolicyFromMessage
protected org.apache.neethi.Policy getBindingPolicyFromMessage(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 interfaceEmitter
- Throws:
CodeGenerationException
- See Also:
Emitter.emitStub()
-
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 interfaceEmitter
- 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
-
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, AxisBindingOperation bindingOperation) throws DOMException
Common code to generate aelement 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, AxisBindingOperation bindingOperation, boolean input)
populate the header parameters- Parameters:
soapHeaderParameterQNameList
-bindingOperation
-input
-
-
addHeaderOperationsToFault
protected void addHeaderOperationsToFault(List soapHeaderParameterQNameList, AxisOperation axisOperation)
populate the header parameters to faults- Parameters:
soapHeaderParameterQNameList
-axisOperation
-
-
getInputElement
protected Element getInputElement(Document doc, AxisBindingOperation bindingOperation, List headerParameterQNameList)
Get the input element- Parameters:
doc
-bindingOperation
-headerParameterQNameList
-- Returns:
- DOM element
-
getFaultElement
protected Element getFaultElement(Document doc, AxisOperation operation)
Get the fault element - No header faults are supported- Parameters:
doc
-operation
-
-
getOutputElement
protected Element getOutputElement(Document doc, AxisBindingOperation bindingOperation, List headerParameterQNameList)
Finds the output element.- Parameters:
doc
-bindingOperation
-headerParameterQNameList
-
-
getFaultParamElements
protected Element[] getFaultParamElements(Document doc, AxisOperation operation)
- Parameters:
doc
-operation
-- Returns:
- Returns the parameter element.
-
getInputParamElement
protected Element[] getInputParamElement(Document doc, 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, AxisOperation operation)
- Parameters:
doc
-operation
-- Returns:
- Returns Element.
-
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)
-
-