Class AxisServiceBasedMultiLanguageEmitter
java.lang.Object
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter
- All Implemented Interfaces:
Emitter
- Direct Known Subclasses:
CEmitter,JavaEmitter,JAXWSEmitter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Mapprotected org.apache.axis2.description.AxisBindingprotected org.apache.axis2.description.AxisEndpointprotected org.apache.axis2.description.AxisServiceprotected Listprotected static final Stringprotected CodeGenConfigurationprotected static final HashMapField constructorMapprotected static final Stringprotected Mapprotected Mapprotected Mapprotected Mapprotected Mapprotected static final org.apache.commons.logging.Logprotected TypeMapperprotected static final Mapprotected static final Mapprotected static final Stringprotected URIResolverprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected intprotected booleanprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttribute(Document document, String AttribName, String attribValue, Element element) Utility method to add an attribute to a given element.protected ElementaddElement(Document document, String eltName, String eltValue, Element element) Utility method to add an attribute to a given element.protected voidaddEndpoint(Document doc, Element rootElement) Adds the endpoint to the document.protected voidaddFaultMessages(List operationFaultMessages, Set faultMessagesToMep) add the qNames of the operation fault message names to faultMessages Mepprotected voidaddHeaderOperations(List soapHeaderParameterQNameList, org.apache.axis2.description.AxisBindingOperation bindingOperation, boolean input) populate the header parametersprotected voidaddHeaderOperationsToFault(List soapHeaderParameterQNameList, org.apache.axis2.description.AxisOperation axisOperation) populate the header parameters to faultsprotected voidaddShortType(Element paramElement, String xmlName) set the short type as it is in the data bindingprotected voidaddSOAPAction(Document doc, Element rootElement, QName qName) Adds the soap actionprotected voidaddSoapVersion(Document doc, Element rootElement) Looks for the SOAPVersion and adds it.voidprotected voidUtility method to copy the faults to the correct mapprotected DocumentcreateDocumentForMessageReceiver(String mep, boolean isServerSideInterface) Creates the XML model for the message receiverprotected DocumentCreates the DOM tree for the Ant build.protected DocumentGenerates the model for the callbacks.protected DocumentGenerates the model for the callbacks.protected DocumentcreateDOMDocumentForInterface(boolean writeDatabinders) Creates the DOM tree for the interface creation.protected DocumentCreates the DOM tree for implementations.protected Documentprotected DocumentcreateDOMDocumentForSkeleton(boolean isSkeletonInterface) Creates the XMLModel for the skeletonprotected DocumentCreates the XML model for the skeleton interfaceprotected DocumentCreates the XML Model for the test caseprotected ElementcreateDOMElementforDatabinders(Document doc, boolean isServerside) create a dom element for databinders.protected voiddebugLogDocument(String description, Document doc) debugging method - write the output to the debuggervoidEmits the skeletonvoidemitStub()Emits the stubcode with bindings.protected voidfillSyncAttributes(Document doc, Element rootElement) protected voidPopulate a map of fault class namesprotected ElementgenerateMethodElement(Document doc, String endpointName, org.apache.axis2.description.AxisBindingOperation bindingOperation) Common code to generate aelement from an operation. protected ElementgenerateOptionParamComponent(Document doc, String name, String value) A convenient method for the generating optionParam componentsprotected ElementgenerateParamComponent(Document doc, String comment, String paramName, String paramType, QName paramQName) A convenient method for the generating the parameter elementprotected ElementgenerateParamComponent(Document doc, String comment, String paramName, String paramType, QName operationName, QName paramQName) A convenient method for the generating the parameter elementprotected ElementgenerateParamComponent(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 ElementGets the base64 types.protected org.apache.neethi.PolicygetBindingPolicyFromMessage(org.apache.axis2.description.AxisBindingOperation axisBindingOperation, String key) protected ObjectgetBindingPropertyFromMessage(String name, QName qName, String key) protected ObjectgetBindingPropertyFromMessageFault(String name, QName qName, String key) protected ObjectgetBindingPropertyFromOperation(String name, QName qName) protected Documentprotected ElementgetFaultElement(Document doc, org.apache.axis2.description.AxisOperation operation) Get the fault element - No header faults are supportedprotected Element[]getFaultParamElements(Document doc, org.apache.axis2.description.AxisOperation operation) protected Stringprotected Stringprotected Stringprotected StringReturns the fully qualified Stub name reused in many methodsprotected ElementgetInputElement(Document doc, org.apache.axis2.description.AxisBindingOperation bindingOperation, List headerParameterQNameList) Get the input elementprotected Element[]getInputParamElement(Document doc, org.apache.axis2.description.AxisOperation operation) getNewCopy(Map copyFormMap) protected ElementgetOpNames(Document doc) Gets an element representing the operation namesprotected FilegetOutputDirectory(File outputDir, String dir2) Gets the output directory for source files.protected ElementgetOutputElement(Document doc, org.apache.axis2.description.AxisBindingOperation bindingOperation, List headerParameterQNameList) Finds the output element.protected ElementgetOutputParamElement(Document doc, org.apache.axis2.description.AxisOperation operation) protected ListgetParameterElementList(Document doc, List parameters, String location) protected ListgetParameterElementListForHttpHeader(Document doc, List parameters, String location) protected ListgetParameterElementListForSOAPModules(Document doc, List parameters) protected StringgetParamInitializer(String paramType) protected ElementgetServiceElement(String serviceName, String className, Document doc) A resusable method to return the service element for creating the service xmlprotected ElementA util method that returns a unique list of faultsprotected ElementgetUniqueListofFaultsofMep(Document doc, String mep) A util method that returns a unique list of faults for a given mepprotected booleanloadOperations(Document doc, Element rootElement, String mep) Loads the operationsprotected StringmakeJavaClassName(String word) protected voidprocessModelObjects(Map objectMappings, Element root, Document doc) protected voidrests the fault name mapsvoidsetCodeGenConfiguration(CodeGenConfiguration configuration) Sets the relevant codegen configurationvoidsetMapper(TypeMapper mapper) Sets the type mapperprotected voidChange the fault classnames to go with the package and stubprotected voidupdateMapperClassnames(String fullyQulifiedIncludingClassNamePrefix) we need to modify the mapper's class name list.protected voidUpdate mapper for message receiverprotected voidUpdate mapper for the stubprotected voidWrites the Ant build.protected voidWrites the callback handlers.protected voidWrites the exceptions.protected voidwriteFile(Document model, FileWriter writer) A resusable method for the implementation of interface and implementation writing.protected voidwriteInterface(boolean writeDatabinders) Writes the interfaces.protected voidWrites the implementations.protected voidWrites the message receiverprotected voidWrite the service XMLprotected voidprotected voidWrite the skeletonInterfaceprotected voidWrite the test classesprotected voidWrite 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 Details
-
CALL_BACK_HANDLER_SUFFIX
- See Also:
-
STUB_SUFFIX
- See Also:
-
TEST_SUFFIX
- See Also:
-
SKELETON_CLASS_SUFFIX
- See Also:
-
SKELETON_CLASS_SUFFIX_BACK
- See Also:
-
SKELETON_INTERFACE_SUFFIX
- See Also:
-
SKELETON_INTERFACE_SUFFIX_BACK
- See Also:
-
STUB_INTERFACE_SUFFIX_BACK
- See Also:
-
MESSAGE_RECEIVER_SUFFIX
- See Also:
-
DATABINDING_SUPPORTER_NAME_SUFFIX
- See Also:
-
mepToClassMap
-
mepToSuffixMap
-
axisBinding
protected org.apache.axis2.description.AxisBinding axisBinding -
axisEndpoint
protected org.apache.axis2.description.AxisEndpoint axisEndpoint -
uniqueFaultNameCounter
protected int uniqueFaultNameCounter -
constructorMap
Field constructorMap -
log
protected static final org.apache.commons.logging.Log log -
resolver
-
infoHolder
-
allServiceInfoHolder
-
codeGenConfiguration
-
mapper
-
axisService
protected org.apache.axis2.description.AxisService axisService -
axisServices
-
fullyQualifiedFaultClassNameMap
-
faultClassNameMap
-
faultElementQNameMap
-
instantiatableMessageClassNames
-
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
Sets the relevant codegen configuration- Specified by:
setCodeGenConfigurationin interfaceEmitter- Parameters:
configuration-- See Also:
-
setMapper
Sets the type mapper -
getBindingPropertyFromOperation
-
getBindingPolicyFromMessage
protected org.apache.neethi.Policy getBindingPolicyFromMessage(org.apache.axis2.description.AxisBindingOperation axisBindingOperation, String key) -
getBindingPropertyFromMessage
-
getBindingPropertyFromMessageFault
-
updateMapperForStub
protected void updateMapperForStub()Update mapper for the stub -
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
Emits the stubcode with bindings.- Specified by:
emitStubin interfaceEmitter- Throws:
CodeGenerationException- See Also:
-
getNewCopy
-
copyMap
-
writeAntBuild
Writes the Ant build.- Throws:
Exception
-
createDOMDocumentForAntBuild
Creates the DOM tree for the Ant build. Uses the interface. -
writeTestClasses
Write the test classes- Throws:
Exception
-
createDOMDocumentForTestCase
Creates the XML Model for the test case- Returns:
- DOM document
-
writeInterfaceImplementation
Writes the implementations.- Throws:
Exception
-
createDOMDocumentForInterfaceImplementation
Creates the DOM tree for implementations.- Throws:
Exception
-
getUniqueListofFaults
A util method that returns a unique list of faults- Parameters:
doc-- Returns:
- DOM element
-
addFaultMessages
add the qNames of the operation fault message names to faultMessages Mep- Parameters:
operationFaultMessages-faultMessagesToMep-
-
getUniqueListofFaultsofMep
A util method that returns a unique list of faults for a given mep- Parameters:
doc-- Returns:
- DOM element
-
addEndpoint
Adds the endpoint to the document.- Parameters:
doc-rootElement-- Throws:
Exception
-
addSoapVersion
Looks for the SOAPVersion and adds it.- Parameters:
doc-rootElement-
-
writeExceptions
Writes the exceptions.- Throws:
Exception
-
createDOMDocumentForException
Generates the model for the callbacks. -
writeCallBackHandlers
Writes the callback handlers.- Throws:
Exception
-
createDOMDocumentForCallbackHandler
Generates the model for the callbacks. -
writeInterface
Writes the interfaces.- Throws:
Exception
-
createDOMDocumentForInterface
Creates the DOM tree for the interface creation. Uses the interface. -
updateMapperForMessageReceiver
protected void updateMapperForMessageReceiver()Update mapper for message receiver -
getFullyQualifiedMessageReceiverName
- Returns:
- fully qualified MR name
-
getFullyQualifiedSkeletonName
- Returns:
- fully qualified skeleton name
-
getFullyQualifiedSkeletonInterfaceName
- Returns:
- fully qualified skeleton interface name
-
emitSkeleton
Emits the skeleton- Specified by:
emitSkeletonin 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
Writes the message receiver- Throws:
Exception
-
createDocumentForMessageReceiver
Creates the XML model for the message receiver- Parameters:
mep-isServerSideInterface-- Returns:
- DOM Document
-
createDOMElementforDatabinders
create a dom element for databinders. This is called by other- Parameters:
doc-
-
addShortType
set the short type as it is in the data binding- Parameters:
paramElement-xmlName-
-
getOpNames
Gets an element representing the operation names- Parameters:
doc-- Returns:
- Returns Element.
-
getBase64Elements
Gets the base64 types. If not available this will be empty!!!- Parameters:
doc-- Returns:
- Returns Element.
-
processModelObjects
- Parameters:
objectMappings-root-doc-
-
updateMapperClassnames
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
Write the service XML- Throws:
Exception
-
createDOMDocumentForServiceXML
-
getServiceElement
A resusable method to return the service element for creating the service xml- Parameters:
serviceName-className-doc-- Returns:
- DOM Element
-
writeSkeleton
- Throws:
Exception
-
writeSkeletonInterface
Write the skeletonInterface- Throws:
Exception
-
createDOMDocumentForSkeleton
Creates the XMLModel for the skeleton- Parameters:
isSkeletonInterface-- Returns:
- DOM Document
-
createDOMDocumentForSkeletonInterface
Creates the XML model for the skeleton interface- Returns:
- DOM Document
-
loadOperations
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 aelement from an operation. - Parameters:
doc-endpointName-bindingOperation-- Returns:
- generated element
- Throws:
DOMException
-
getEmptyDocument
-
makeJavaClassName
- 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
- Parameters:
doc-rootElement-
-
debugLogDocument
debugging method - write the output to the debugger- Parameters:
description-doc-
-
getOutputDirectory
Gets the output directory for source files.- Parameters:
outputDir-- Returns:
- Returns File.
-
writeFile
A resusable method for the implementation of interface and implementation writing.- Parameters:
model-writer-- Throws:
IOExceptionException
-
addSOAPAction
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
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
- Parameters:
paramType-
-
getParameterElementList
- Parameters:
doc-parameters-location-
-
getParameterElementListForHttpHeader
-
getParameterElementListForSOAPModules
-
addElement
Utility method to add an attribute to a given element.- Parameters:
document-eltName-eltValue-element-
-