Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.axis.wsdl.fromJava.Emitter
public class Emitter
extends java.lang.Object
Field Summary | |
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
protected static Log |
|
protected static TypeMapping |
|
protected Types |
|
Constructor Summary | |
|
Method Summary | |
protected Definition |
|
protected Element |
|
protected QName |
|
protected Types |
|
void |
|
void |
|
void |
|
Document |
|
String |
|
Vector |
|
String |
|
Class |
|
TypeMapping |
|
String |
|
Vector |
|
Class[] |
|
Class |
|
String |
|
Definition |
|
String |
|
String | |
String |
|
String |
|
Definition |
|
String |
|
int |
|
Map |
|
String |
|
HashMap |
|
protected QName |
|
protected QName |
|
ServiceDesc |
|
String |
|
String |
|
String |
|
ArrayList |
|
Style |
|
String |
|
TypeMapping |
|
Use |
|
boolean |
|
String |
|
Definition |
|
protected void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
protected Binding |
|
protected BindingOperation |
|
protected void |
|
protected Message |
|
protected void |
|
protected void |
|
protected BindingOperation |
|
String |
|
protected void |
|
protected Message |
|
protected Message |
|
protected ExtensibilityElement |
|
protected SOAPFault |
|
protected SOAPHeader |
|
protected void |
|
String |
|
public static final int MODE_ALL
Field MODE_ALL
- Field Value:
- 0
public static final int MODE_DOCUMENT
DEPRECATED - Indicates style=document use=literal
- Field Value:
- 1
public static final int MODE_DOC_WRAPPED
DEPRECATED - Indicates style=wrapped use=literal
- Field Value:
- 2
public static final int MODE_IMPLEMENTATION
Field MODE_IMPLEMENTATION
- Field Value:
- 2
public static final int MODE_INTERFACE
Field MODE_INTERFACE
- Field Value:
- 1
public static final int MODE_RPC
DEPRECATED - Indicates style=rpc use=encoded
- Field Value:
- 0
protected static Log log
Field log
public Emitter()
Construct Emitter. Set the contextual information using set* methods Invoke emit to emit the code
protected Definition createDefinition() throws WSDLException, SAXException, IOException, ParserConfigurationException
Build a Definition from the input wsdl file or create a new Definition
- Returns:
- WSDL Definition
protected Element createDocumentationElement(String documentation)
Create a documentation element
- Parameters:
documentation
-
- Returns:
protected QName createMessageName(Definition def, String methodName)
Method createMessageName
- Parameters:
def
-methodName
-
- Returns:
protected Types createTypes(Definition def) throws IOException, WSDLException, SAXException, ParserConfigurationException
Build a Types object and load the input wsdl types
- Parameters:
def
- Corresponding wsdl Definition
- Returns:
- Types object
public void emit(String filename) throws IOException, WSDLException, SAXException, ParserConfigurationException
Generates a complete WSDL document for a givenClass
- Parameters:
filename
- WSDL
public void emit(String filename1, String filename2) throws IOException, WSDLException, SAXException, ParserConfigurationException
Generates WSDL documents for a givenClass
- Parameters:
filename1
- interface WSDLfilename2
- implementation WSDL
public void emit(String filename, int mode) throws IOException, WSDLException, SAXException, ParserConfigurationException
Generates a WSDL document for a givenClass
. The WSDL generated is controlled by the mode parameter mode 0: All mode 1: Interface mode 2: Implementation
- Parameters:
filename
- WSDLmode
- generation mode - all, interface, implementation
public Document emit(int mode) throws IOException, WSDLException, SAXException, ParserConfigurationException
Generates a WSDL document for a givenClass
. The WSDL generated is controlled by the mode parameter mode 0: All mode 1: Interface mode 2: Implementation
- Parameters:
mode
- generation mode - all, interface, implementation
- Returns:
- Document
public String emitToString(int mode) throws IOException, WSDLException, SAXException, ParserConfigurationException
Generates a String containing the WSDL for a givenClass
. The WSDL generated is controlled by the mode parameter mode 0: All mode 1: Interface mode 2: Implementation
- Parameters:
mode
- generation mode - all, interface, implementation
- Returns:
- String
public Vector getAllowedMethods()
Returns a vector of methods to export
- Returns:
- a space separated list of methods to export
public String getBindingName()
Returns the String representation of the binding name
- Returns:
- String representation of the binding name
public Class getCls()
Returns theClass
to export
- Returns:
- the
Class
to export
public TypeMapping getDefaultTypeMapping()
Deprecated. Use getTypeMappingRegistry instead
Returns thedefaultTypeMapping
used by the service
- Returns:
- the
defaultTypeMapping
used by the service
public String getDescription()
Returns the service description
- Returns:
- service description String
public Vector getDisallowedMethods()
Return list of methods that should not be exported
- Returns:
public Class[] getExtraClasses()
Return the list of extra classes that the emitter will produce WSDL for.
- Returns:
public Class getImplCls()
Returns the implementationClass
if set
- Returns:
- the implementation Class or null
public String getImplNamespace()
Returns the implementation namespace
- Returns:
- implementation target namespace
public Definition getImplWSDL() throws IOException, WSDLException, SAXException, ParserConfigurationException
Get implementation WSDLDefinition
for the current configuration parameters
- Returns:
- WSDL
Definition
public String getImportUrl()
Returns the String representation of the interface import location URL
- Returns:
- String representation of the interface import location URL
public String getInputSchema()
- Returns:
- the name of the input schema, or null
public String getInputWSDL()
Get the name of the input WSDL
- Returns:
- name of the input wsdl or null
public String getIntfNamespace()
Returns the interface namespace
- Returns:
- interface target namespace
public Definition getIntfWSDL() throws IOException, WSDLException, SAXException, ParserConfigurationException
Get a interface WSDLDefinition
for the current configuration parameters
- Returns:
- WSDL
Definition
public String getLocationUrl()
Returns the String representation of the service endpoint URL
- Returns:
- String representation of the service endpoint URL
public int getMode()
Deprecated. (use getStyle and getUse)
getMode (gets the mode based on the style setting)
- Returns:
- returns the mode (-1 if invalid)
public Map getNamespaceMap()
get the packagename to namespace map
- Returns:
Map
public String getPortTypeName()
Returns the String representation of the portType name
- Returns:
- String representation of the portType name
public HashMap getQName2ClassMap()
Return the type qname to java type mapping
- Returns:
- mapping of type qname to its corresponding java type
protected QName getRequestQName(OperationDesc oper)
Method getRequestQName
- Parameters:
oper
-
- Returns:
protected QName getResponseQName(OperationDesc oper)
Method getResponseQName
- Parameters:
oper
-
- Returns:
public String getServiceElementName()
Returns the String representation of the service element name
- Returns:
- String representation of the service element name
public String getServicePortName()
Returns the String representation of the service port name
- Returns:
- String representation of the service port name
public String getSoapAction()
Returns the soapAction option value
- Returns:
- the String DEFAULT, NONE or OPERATION
public ArrayList getStopClasses()
Return the list of classes which stop inhertance searches
- Returns:
public Style getStyle()
getStyle
- Returns:
- Style setting (Style.RPC, Style.DOCUMENT, Style.WRAPPED, etc.)
public String getTargetService()
Returns the target service name
- Returns:
- the target service name
public TypeMapping getTypeMapping()
Returns theTypeMapping
used by the service
- Returns:
- the
TypeMapping
used by the service
public boolean getUseInheritedMethods()
Indicates if the emitter will search classes for inherited methods
- Returns:
public String getVersionMessage()
Return the version message
- Returns:
- message or null if emitter will use the default
public Definition getWSDL() throws IOException, WSDLException, SAXException, ParserConfigurationException
Get a Full WSDLDefinition
for the current configuration parameters
- Returns:
- WSDL
Definition
protected void init(int mode)
Invoked prior to building a definition to ensure parms and data are set up.
- Parameters:
mode
-
protected void prettyDocumentToFile(Document doc, String filename) throws IOException
Write a prettified document to a file.
- Parameters:
doc
- the Document to writefilename
- the name of the file to be written
public void setAllowedMethods(String text)
Add a list of methods to export
- Parameters:
text
-
public void setAllowedMethods(Vector allowedMethods)
Add a Vector of methods to export
- Parameters:
allowedMethods
- a vector of methods to export
public void setBindingName(String bindingName)
Set the String representation of the binding name
- Parameters:
bindingName
- the String representation of the binding name
public void setCls(Class cls)
Sets theClass
to export
- Parameters:
cls
- theClass
to export
public void setCls(String className) throws ClassNotFoundException
Sets theClass
to export
- Parameters:
className
- the name of theClass
to export
public void setClsSmart(Class cls, String location)
Sets theClass
to export.
- Parameters:
cls
- theClass
to exportlocation
-
public void setDefaultTypeMapping(TypeMapping tm)
Deprecated. Use setTypeMappingRegistry instead
Sets thedefaultTypeMapping
used by the service
- Parameters:
tm
- thedefaultTypeMapping
used by the service
public void setDescription(String description)
Set the service description
- Parameters:
description
- service description String
public void setDisallowedMethods(String text)
Add a list of methods NOT to export
- Parameters:
text
- space separated list of method names
public void setDisallowedMethods(Vector disallowedMethods)
Add a list of methods NOT to export
- Parameters:
disallowedMethods
- vector of method name strings
public void setEmitAllTypes(boolean emitAllTypes)
public void setExtraClasses(Class[] extraClasses)
Provide a list of classes which the emitter will produce WSDL type definitions for.
- Parameters:
extraClasses
-
public void setExtraClasses(String text) throws ClassNotFoundException
Provide a comma or space seperated list of classes which the emitter will produce WSDL type definitions for. The classes will be added to the current list.
- Parameters:
text
-
public void setImplCls(Class implCls)
Sets the implementationClass
- Parameters:
implCls
- theClass
to export
public void setImplCls(String className)
Sets the implementationClass
- Parameters:
className
- the name of the implementationClass
public void setImplNamespace(String ns)
Set the implementation namespace
- Parameters:
ns
- implementation target namespace
public void setImportUrl(String importUrl)
Set the String representation of the interface location URL for importing
- Parameters:
importUrl
- the String representation of the interface location URL for importing
public void setInputSchema(String inputSchema)
Set the name of the input schema
- Parameters:
inputSchema
- the name of the input schema
public void setInputWSDL(String inputWSDL)
Set the name of the input WSDL
- Parameters:
inputWSDL
- the name of the input WSDL
public void setIntfNamespace(String ns)
Set the interface namespace
- Parameters:
ns
- interface target namespace
public void setLocationUrl(String locationUrl)
Set the String representation of the service endpoint URL
- Parameters:
locationUrl
- the String representation of the service endpoint URL
public void setMode(int mode)
Deprecated. (use setStyle and setUse)
setMode (sets style and use)
- Parameters:
mode
-
public void setNamespaceMap(Map map)
Set the packagename to namespace map with the given map
- Parameters:
map
- packagename/namespaceMap
public void setPortTypeName(String portTypeName)
Set the String representation of the portType name
- Parameters:
portTypeName
- the String representation of the portType name
public void setServiceDesc(ServiceDesc serviceDesc)
Method setServiceDesc
- Parameters:
serviceDesc
-
public void setServiceElementName(String serviceElementName)
Set the String representation of the service element name
- Parameters:
serviceElementName
- the String representation of the service element name
public void setServicePortName(String servicePortName)
Set the String representation of the service port name
- Parameters:
servicePortName
- the String representation of the service port name
public void setSoapAction(String value)
Sets the soapAction option value
- Parameters:
value
- must be DEFAULT, NONE, or OPERATION
public 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
- Parameters:
stopClasses
- vector of class name strings
public 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
- Parameters:
text
- space separated list of class names
public void setStyle(String value)
setStyle
- Parameters:
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
NOTE: If style is specified as "wrapped", use is set to literal.
public void setTargetService(String targetService)
Set the target service name
- Parameters:
targetService
- the target service name
public void setTypeMapping(TypeMapping tm)
Sets theTypeMapping
used by the service
- Parameters:
tm
- theTypeMapping
used by the service
public void setTypeMappingRegistry(TypeMappingRegistry tmr)
Set the TypeMappingRegistry for this Emitter.
public void setUse(String value)
setUse
- Parameters:
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/Use
public void setUseInheritedMethods(boolean useInheritedMethods)
Turn on or off inherited method WSDL generation.
- Parameters:
useInheritedMethods
-
public 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. If set to an empty string, no version message will be emitted
- Parameters:
versionMessage
- the message to emit
protected Binding writeBinding(Definition def, boolean add)
Create the binding.
- Parameters:
def
-Definition
add
- true if binding should be added to the def
- Returns:
protected BindingOperation writeBindingOperation(Definition def, Binding binding, Operation oper, OperationDesc desc)
Create a Binding Operation
- Parameters:
def
-binding
-oper
-desc
-
- Returns:
protected void writeDefinitions(Definition def, String tns)
Create the definition header information.
- Parameters:
def
-Definition
tns
- target namespace
protected Message writeFaultMessage(Definition def, FaultDesc exception) throws WSDLException, AxisFault
Create a Fault Message
- Parameters:
def
-exception
- (an ExceptionRep object)
- Returns:
- Throws:
AxisFault
-
protected void writeImport(Definition def, String tns, String loc)
Create and add an import
- Parameters:
def
-Definition
tns
- target namespaceloc
- target location
protected void writeMessages(Definition def, Operation oper, OperationDesc desc, BindingOperation bindingOper) throws WSDLException, AxisFault
Create a Message
- Parameters:
def
- Definition, the WSDL definitionoper
- Operation, the wsdl operationdesc
- OperationDesc, the Operation DescriptionbindingOper
- BindingOperation, corresponding Binding Operation
- Throws:
AxisFault
-
protected BindingOperation writeOperation(Definition def, Binding binding, OperationDesc desc)
Create a Operation
- Parameters:
def
-binding
-desc
-
- Returns:
public String writePartToMessage(Definition def, Message msg, boolean request, ParameterDesc param) throws WSDLException, AxisFault
Create a Part
- Parameters:
def
-msg
-request
- message is for a requestparam
- ParamRep object
- Returns:
- The parameter name added or null
- Throws:
AxisFault
-
protected void writePortType(Definition def, Binding binding) throws WSDLException, AxisFault
Create a PortType
- Parameters:
def
-binding
-
- Throws:
AxisFault
-
protected Message writeRequestMessage(Definition def, OperationDesc oper, BindingOperation bindop) throws WSDLException, AxisFault
Create a Request Message
- Parameters:
def
-oper
-
- Returns:
- Throws:
AxisFault
-
protected Message writeResponseMessage(Definition def, OperationDesc desc, BindingOperation bindop) throws WSDLException, AxisFault
Create a Response Message
- Parameters:
def
-desc
-
- Returns:
- Throws:
AxisFault
-
protected ExtensibilityElement writeSOAPBody(QName operQName)
Method writeSOAPBody
- Parameters:
operQName
-
- Returns:
protected SOAPFault writeSOAPFault(FaultDesc faultDesc)
Method writeSOAPFault
- Parameters:
faultDesc
-
- Returns:
protected SOAPHeader writeSOAPHeader(ParameterDesc p, QName messageQName, String partName)
Create a SOAPHeader element
protected void writeService(Definition def, Binding binding)
Create the service.
- Parameters:
def
-binding
-
public String writeWrapperPart(Definition def, Message msg, OperationDesc oper, boolean request) throws AxisFault
Write out the schema definition for a WRAPPED operation request or response.
- Parameters:
def
-msg
-oper
-request
-
- Returns:
- the name of the part the was written
- Throws:
AxisFault
-