public class Emitter extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
Field log
|
static int |
MODE_ALL
Field MODE_ALL
|
static int |
MODE_DOC_WRAPPED
DEPRECATED - Indicates style=wrapped use=literal
|
static int |
MODE_DOCUMENT
DEPRECATED - Indicates style=document use=literal
|
static int |
MODE_IMPLEMENTATION
Field MODE_IMPLEMENTATION
|
static int |
MODE_INTERFACE
Field MODE_INTERFACE
|
static int |
MODE_RPC
DEPRECATED - Indicates style=rpc use=encoded
|
protected static TypeMapping |
standardTypes
Field standardTypes
|
protected Types |
types
Field types
|
Constructor and Description |
---|
Emitter()
Construct Emitter.
|
Modifier and Type | Method and Description |
---|---|
protected javax.wsdl.Definition |
createDefinition()
Build a Definition from the input wsdl file or create
a new Definition
|
protected Element |
createDocumentationElement(String documentation)
Create a documentation element
|
protected QName |
createMessageName(javax.wsdl.Definition def,
String methodName)
Method createMessageName
|
protected Types |
createTypes(javax.wsdl.Definition def)
Build a Types object and load the input wsdl types
|
Document |
emit(int mode)
Generates a WSDL document for a given
Class . |
void |
emit(String filename)
Generates a complete WSDL document for a given
Class |
void |
emit(String filename,
int mode)
Generates a WSDL document for a given
Class . |
void |
emit(String filename1,
String filename2)
Generates WSDL documents for a given
Class |
String |
emitToString(int mode)
Generates a String containing the WSDL for a given
Class . |
Vector |
getAllowedMethods()
Returns a vector of methods to export
|
String |
getBindingName()
Returns the String representation of the binding name
|
Class |
getCls()
Returns the
Class to export |
TypeMapping |
getDefaultTypeMapping()
Deprecated.
Use getTypeMappingRegistry instead
|
String |
getDescription()
Returns the service description
|
Vector |
getDisallowedMethods()
Return list of methods that should not be exported
|
Class[] |
getExtraClasses()
Return the list of extra classes that the emitter will produce WSDL for.
|
Class |
getImplCls()
Returns the implementation
Class if set |
String |
getImplNamespace()
Returns the implementation namespace
|
javax.wsdl.Definition |
getImplWSDL()
Get implementation WSDL
Definition for the
current configuration parameters |
String |
getImportUrl()
Returns the String representation of the interface import location URL
|
String |
getInputSchema() |
String |
getInputWSDL()
Get the name of the input WSDL
|
String |
getIntfNamespace()
Returns the interface namespace
|
javax.wsdl.Definition |
getIntfWSDL()
Get a interface WSDL
Definition for the
current configuration parameters |
String |
getLocationUrl()
Returns the String representation of the service endpoint URL
|
int |
getMode()
Deprecated.
(use getStyle and getUse)
|
Map |
getNamespaceMap()
get the packagename to namespace map
|
String |
getPortTypeName()
Returns the String representation of the portType name
|
HashMap |
getQName2ClassMap()
Return the type qname to java type mapping
|
protected QName |
getRequestQName(OperationDesc oper)
Method getRequestQName
|
protected QName |
getResponseQName(OperationDesc oper)
Method getResponseQName
|
ServiceDesc |
getServiceDesc()
Method getServiceDesc
|
String |
getServiceElementName()
Returns the String representation of the service element name
|
String |
getServicePortName()
Returns the String representation of the service port name
|
String |
getSoapAction()
Returns the soapAction option value
|
ArrayList |
getStopClasses()
Return the list of classes which stop inhertance searches
|
Style |
getStyle()
getStyle
|
String |
getTargetService()
Returns the target service name
|
TypeMapping |
getTypeMapping()
Returns the
TypeMapping used by the service |
Use |
getUse()
getUse
|
boolean |
getUseInheritedMethods()
Indicates if the emitter will search classes for inherited methods
|
String |
getVersionMessage()
Return the version message
|
javax.wsdl.Definition |
getWSDL()
Get a Full WSDL
Definition for the current
configuration parameters |
protected void |
init(int mode)
Invoked prior to building a definition to ensure parms
and data are set up.
|
protected void |
prettyDocumentToFile(Document doc,
String filename)
Write a prettified document to a file.
|
void |
setAllowedMethods(String text)
Add a list of methods to export
|
void |
setAllowedMethods(Vector allowedMethods)
Add a Vector of methods to export
|
void |
setBindingName(String bindingName)
Set the String representation of the binding name
|
void |
setCls(Class cls)
Sets the
Class to export |
void |
setClsSmart(Class cls,
String location)
Sets the
Class to export. |
void |
setDefaultTypeMapping(TypeMapping tm)
Deprecated.
Use setTypeMappingRegistry instead
|
void |
setDescription(String description)
Set the service description
|
void |
setDisallowedMethods(String text)
Add a list of methods NOT to export
|
void |
setDisallowedMethods(Vector disallowedMethods)
Add a list of methods NOT to export
|
void |
setEmitAllTypes(boolean emitAllTypes) |
void |
setExtraClasses(Class[] extraClasses)
Provide a list of classes which the emitter will produce WSDL
type definitions for.
|
void |
setExtraClasses(String text,
ClassLoader classLoader)
Convenience method that processes a comma or space separated list of classes which the
emitter will produce WSDL type definitions for.
|
void |
setImplCls(Class implCls)
Sets the implementation
Class |
void |
setImplNamespace(String ns)
Set the implementation namespace
|
void |
setImportUrl(String importUrl)
Set the String representation of the interface location URL
for importing
|
void |
setInputSchema(String inputSchema)
Set the name of the input schema
|
void |
setInputWSDL(String inputWSDL)
Set the name of the input WSDL
|
void |
setIntfNamespace(String ns)
Set the interface namespace
|
void |
setLocationUrl(String locationUrl)
Set the String representation of the service endpoint URL
|
void |
setMode(int mode)
Deprecated.
(use setStyle and setUse)
|
void |
setNamespaceMap(Map map)
Set the packagename to namespace map with the given map
|
void |
setPortTypeName(String portTypeName)
Set the String representation of the portType name
|
void |
setServiceDesc(ServiceDesc serviceDesc)
Method setServiceDesc
|
void |
setServiceElementName(String serviceElementName)
Set the String representation of the service element name
|
void |
setServicePortName(String servicePortName)
Set the String representation of the service port name
|
void |
setSoapAction(String value)
Sets the soapAction option value
|
void |
setStopClasses(ArrayList stopClasses)
Adds a list of classes (fully qualified) that will stop the traversal
of the inheritance tree if encounter in method or complex type generation
|
void |
setStopClasses(String text)
Add a list of classes (fully qualified) that will stop the traversal
of the inheritance tree if encounter in method or complex type generation
|
void |
setStyle(String value)
setStyle
|
void |
setStyle(Style value)
setStyle
|
void |
setTargetService(String targetService)
Set the target service name
|
void |
setTypeMapping(TypeMapping tm)
Sets the
TypeMapping used by the service |
void |
setTypeMappingRegistry(TypeMappingRegistry tmr)
Set the TypeMappingRegistry for this Emitter.
|
void |
setUse(String value)
setUse
|
void |
setUse(Use value)
setUse
|
void |
setUseInheritedMethods(boolean useInheritedMethods)
Turn on or off inherited method WSDL generation.
|
void |
setVersionMessage(String versionMessage)
Set the version message that appears at the top of the WSDL
If not set, we use the default version message.
|
protected javax.wsdl.Binding |
writeBinding(javax.wsdl.Definition def,
boolean add)
Create the binding.
|
protected javax.wsdl.BindingOperation |
writeBindingOperation(javax.wsdl.Definition def,
javax.wsdl.Binding binding,
javax.wsdl.Operation oper,
OperationDesc desc)
Create a Binding Operation
|
protected void |
writeDefinitions(javax.wsdl.Definition def,
String tns)
Create the definition header information.
|
protected javax.wsdl.Message |
writeFaultMessage(javax.wsdl.Definition def,
FaultDesc exception)
Create a Fault Message
|
protected void |
writeImport(javax.wsdl.Definition def,
String tns,
String loc)
Create and add an import
|
protected void |
writeMessages(javax.wsdl.Definition def,
javax.wsdl.Operation oper,
OperationDesc desc,
javax.wsdl.BindingOperation bindingOper)
Create a Message
|
protected javax.wsdl.BindingOperation |
writeOperation(javax.wsdl.Definition def,
javax.wsdl.Binding binding,
OperationDesc desc)
Create a Operation
|
String |
writePartToMessage(javax.wsdl.Definition def,
javax.wsdl.Message msg,
boolean request,
ParameterDesc param)
Create a Part
|
protected void |
writePortType(javax.wsdl.Definition def,
javax.wsdl.Binding binding)
Create a PortType
|
protected javax.wsdl.Message |
writeRequestMessage(javax.wsdl.Definition def,
OperationDesc oper,
javax.wsdl.BindingOperation bindop)
Create a Request Message
|
protected javax.wsdl.Message |
writeResponseMessage(javax.wsdl.Definition def,
OperationDesc desc,
javax.wsdl.BindingOperation bindop)
Create a Response Message
|
protected void |
writeService(javax.wsdl.Definition def,
javax.wsdl.Binding binding)
Create the service.
|
protected javax.wsdl.extensions.ExtensibilityElement |
writeSOAPBody(QName operQName)
Method writeSOAPBody
|
protected javax.wsdl.extensions.soap.SOAPFault |
writeSOAPFault(FaultDesc faultDesc)
Method writeSOAPFault
|
protected javax.wsdl.extensions.soap.SOAPHeader |
writeSOAPHeader(ParameterDesc p,
QName messageQName,
String partName)
Create a SOAPHeader element
|
String |
writeWrapperPart(javax.wsdl.Definition def,
javax.wsdl.Message msg,
OperationDesc oper,
boolean request)
Write out the schema definition for a WRAPPED operation request or
response.
|
protected static org.apache.commons.logging.Log log
public static final int MODE_ALL
public static final int MODE_INTERFACE
public static final int MODE_IMPLEMENTATION
protected Types types
public static final int MODE_RPC
public static final int MODE_DOCUMENT
public static final int MODE_DOC_WRAPPED
protected static TypeMapping standardTypes
public Emitter()
public void emit(String filename1, String filename2) throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Class
filename1
- interface WSDLfilename2
- implementation WSDLIOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
public void emit(String filename) throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Class
filename
- WSDLIOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
public Document emit(int mode) throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Class
.
The WSDL generated is controlled by the mode parameter
mode 0: All
mode 1: Interface
mode 2: Implementationmode
- generation mode - all, interface, implementationIOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
public String emitToString(int mode) throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Class
.
The WSDL generated is controlled by the mode parameter
mode 0: All
mode 1: Interface
mode 2: Implementationmode
- generation mode - all, interface, implementationIOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
public void emit(String filename, int mode) throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Class
.
The WSDL generated is controlled by the mode parameter
mode 0: All
mode 1: Interface
mode 2: Implementationfilename
- WSDLmode
- generation mode - all, interface, implementationIOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
public javax.wsdl.Definition getWSDL() throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Definition
for the current
configuration parametersDefinition
IOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
public javax.wsdl.Definition getIntfWSDL() throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Definition
for the
current configuration parametersDefinition
IOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
public javax.wsdl.Definition getImplWSDL() throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
Definition
for the
current configuration parametersDefinition
IOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
protected void init(int mode)
mode
- protected javax.wsdl.Definition createDefinition() throws javax.wsdl.WSDLException, SAXException, IOException, ParserConfigurationException
javax.wsdl.WSDLException
SAXException
IOException
ParserConfigurationException
protected Types createTypes(javax.wsdl.Definition def) throws IOException, javax.wsdl.WSDLException, SAXException, ParserConfigurationException
def
- Corresponding wsdl DefinitionIOException
javax.wsdl.WSDLException
SAXException
ParserConfigurationException
protected Element createDocumentationElement(String documentation)
documentation
- protected void writeDefinitions(javax.wsdl.Definition def, String tns)
def
- Definition
tns
- target namespaceprotected void writeImport(javax.wsdl.Definition def, String tns, String loc)
def
- Definition
tns
- target namespaceloc
- target locationprotected javax.wsdl.Binding writeBinding(javax.wsdl.Definition def, boolean add)
def
- Definition
add
- true if binding should be added to the defprotected void writeService(javax.wsdl.Definition def, javax.wsdl.Binding binding)
def
- binding
- protected void writePortType(javax.wsdl.Definition def, javax.wsdl.Binding binding) throws javax.wsdl.WSDLException, AxisFault
def
- binding
- javax.wsdl.WSDLException
AxisFault
protected void writeMessages(javax.wsdl.Definition def, javax.wsdl.Operation oper, OperationDesc desc, javax.wsdl.BindingOperation bindingOper) throws javax.wsdl.WSDLException, AxisFault
def
- Definition, the WSDL definitionoper
- Operation, the wsdl operationdesc
- OperationDesc, the Operation DescriptionbindingOper
- BindingOperation, corresponding Binding Operationjavax.wsdl.WSDLException
AxisFault
protected javax.wsdl.BindingOperation writeOperation(javax.wsdl.Definition def, javax.wsdl.Binding binding, OperationDesc desc)
def
- binding
- desc
- protected javax.wsdl.BindingOperation writeBindingOperation(javax.wsdl.Definition def, javax.wsdl.Binding binding, javax.wsdl.Operation oper, OperationDesc desc)
def
- binding
- oper
- desc
- protected javax.wsdl.extensions.soap.SOAPHeader writeSOAPHeader(ParameterDesc p, QName messageQName, String partName)
protected javax.wsdl.extensions.ExtensibilityElement writeSOAPBody(QName operQName)
operQName
- protected javax.wsdl.extensions.soap.SOAPFault writeSOAPFault(FaultDesc faultDesc)
faultDesc
- protected javax.wsdl.Message writeRequestMessage(javax.wsdl.Definition def, OperationDesc oper, javax.wsdl.BindingOperation bindop) throws javax.wsdl.WSDLException, AxisFault
def
- oper
- javax.wsdl.WSDLException
AxisFault
protected QName getRequestQName(OperationDesc oper)
oper
- protected QName getResponseQName(OperationDesc oper)
oper
- public String writeWrapperPart(javax.wsdl.Definition def, javax.wsdl.Message msg, OperationDesc oper, boolean request) throws AxisFault
def
- msg
- oper
- request
- AxisFault
protected javax.wsdl.Message writeResponseMessage(javax.wsdl.Definition def, OperationDesc desc, javax.wsdl.BindingOperation bindop) throws javax.wsdl.WSDLException, AxisFault
def
- desc
- javax.wsdl.WSDLException
AxisFault
protected javax.wsdl.Message writeFaultMessage(javax.wsdl.Definition def, FaultDesc exception) throws javax.wsdl.WSDLException, AxisFault
def
- exception
- (an ExceptionRep object)javax.wsdl.WSDLException
AxisFault
public String writePartToMessage(javax.wsdl.Definition def, javax.wsdl.Message msg, boolean request, ParameterDesc param) throws javax.wsdl.WSDLException, AxisFault
def
- msg
- request
- message is for a requestparam
- ParamRep objectjavax.wsdl.WSDLException
AxisFault
protected QName createMessageName(javax.wsdl.Definition def, String methodName)
def
- methodName
- protected void prettyDocumentToFile(Document doc, String filename) throws IOException
doc
- the Document to writefilename
- the name of the file to be writtenIOException
- various file i/o exceptionspublic Class getCls()
Class
to exportClass
to exportpublic void setCls(Class cls)
Class
to exportcls
- the Class
to exportpublic void setClsSmart(Class cls, String location)
Class
to export.cls
- the Class
to exportlocation
- public Class getImplCls()
Class
if setpublic void setImplCls(Class implCls)
Class
implCls
- the Class
to exportpublic String getIntfNamespace()
public void setIntfNamespace(String ns)
ns
- interface target namespacepublic String getImplNamespace()
public void setImplNamespace(String ns)
ns
- implementation target namespacepublic Vector getAllowedMethods()
public void setAllowedMethods(String text)
text
- public void setAllowedMethods(Vector allowedMethods)
allowedMethods
- a vector of methods to exportpublic boolean getUseInheritedMethods()
public void setUseInheritedMethods(boolean useInheritedMethods)
useInheritedMethods
- public void setDisallowedMethods(Vector disallowedMethods)
disallowedMethods
- vector of method name stringspublic void setDisallowedMethods(String text)
text
- space separated list of method namespublic Vector getDisallowedMethods()
public void setStopClasses(ArrayList stopClasses)
stopClasses
- vector of class name stringspublic void setStopClasses(String text)
text
- space separated list of class namespublic ArrayList getStopClasses()
public Map getNamespaceMap()
Map
public void setNamespaceMap(Map map)
map
- packagename/namespace Map
public String getInputWSDL()
public void setInputWSDL(String inputWSDL)
inputWSDL
- the name of the input WSDLpublic String getInputSchema()
public void setInputSchema(String inputSchema)
inputSchema
- the name of the input schemapublic String getLocationUrl()
public void setLocationUrl(String locationUrl)
locationUrl
- the String representation of the service endpoint URLpublic String getImportUrl()
public void setImportUrl(String importUrl)
importUrl
- the String representation of the interface
location URL for importingpublic String getServicePortName()
public void setServicePortName(String servicePortName)
servicePortName
- the String representation of the service port namepublic String getServiceElementName()
public void setServiceElementName(String serviceElementName)
serviceElementName
- the String representation of the service element namepublic String getPortTypeName()
public void setPortTypeName(String portTypeName)
portTypeName
- the String representation of the portType namepublic String getBindingName()
public void setBindingName(String bindingName)
bindingName
- the String representation of the binding namepublic String getTargetService()
public void setTargetService(String targetService)
targetService
- the target service namepublic String getDescription()
public void setDescription(String description)
description
- service description Stringpublic String getSoapAction()
public void setSoapAction(String value)
value
- must be DEFAULT, NONE, or OPERATIONpublic TypeMapping getTypeMapping()
TypeMapping
used by the serviceTypeMapping
used by the servicepublic void setTypeMapping(TypeMapping tm)
TypeMapping
used by the servicetm
- the TypeMapping
used by the servicepublic TypeMapping getDefaultTypeMapping()
defaultTypeMapping
used by the servicedefaultTypeMapping
used by the servicepublic void setDefaultTypeMapping(TypeMapping tm)
defaultTypeMapping
used by the servicetm
- the defaultTypeMapping
used by the servicepublic void setTypeMappingRegistry(TypeMappingRegistry tmr)
public Style getStyle()
public void setStyle(String value)
value
- String representing a style ("document", "rpc", "wrapped")
Note that the case of the string is not important. "document" and "DOCUMENT"
are both treated as document style.
If the value is not a know style, the default setting is used.
See org.apache.axis.constants.Style for a description of the interaction between
Style/Use
public void setStyle(Style value)
value
- Style settingpublic Use getUse()
public void setUse(String value)
value
- String representing a use ("literal", "encoded")
Note that the case of the string is not important. "literal" and "LITERAL"
are both treated as literal use.
If the value is not a know use, the default setting is used.
See org.apache.axis.constants.Style for a description of the interaction between
Style/Usepublic void setUse(Use value)
value
- Use settingpublic void setMode(int mode)
mode
- public int getMode()
public ServiceDesc getServiceDesc()
public void setServiceDesc(ServiceDesc serviceDesc)
serviceDesc
- public Class[] getExtraClasses()
public void setExtraClasses(Class[] extraClasses)
extraClasses
- public void setExtraClasses(String text, ClassLoader classLoader) throws ClassNotFoundException
text
- a comma or space separated list of class namesclassLoader
- the class loader that should be used to load the classesClassNotFoundException
public void setEmitAllTypes(boolean emitAllTypes)
public String getVersionMessage()
public void setVersionMessage(String versionMessage)
versionMessage
- the message to emitpublic HashMap getQName2ClassMap()
Copyright © The Apache Software Foundation. All Rights Reserved.