org.apache.axis.wsdlgen
Class Emitter

java.lang.Object
  |
  +--org.apache.axis.wsdlgen.Emitter

public class Emitter
extends java.lang.Object

WSDL utility class, 1st cut. Right now all the WSDL functionality for dynamic Java->WSDL is in here - it probably wants to move elsewhere when a more solid design stabilizes.

Author:
Glen Daniels (gdaniels@macromedia.com)

Field Summary
static int MODE_ALL
           
static int MODE_IMPLEMENTATION
           
static int MODE_INTERFACE
           
 
Constructor Summary
Emitter()
          Construct Emitter.
 
Method Summary
 void emit(java.lang.String filename)
          Generates a complete WSDL document for a given Class
 void emit(java.lang.String filename, int mode)
          Generates a WSDL document for a given Class.
 void emit(java.lang.String filename1, java.lang.String filename2)
          Generates WSDL documents for a given Class
 java.lang.String getAllowedMethods()
          Returns a list of a space separated list of methods to export
 java.lang.Class getCls()
          Returns the Class to export
 java.lang.String getDescription()
          Returns the service description
 java.lang.String getImplNamespace()
          Returns the implementation namespace
 javax.wsdl.Definition getImplWSDL()
          Get implementation WSDL Definition for the current configuration parameters
 java.lang.String getImportUrl()
          Returns the String representation of the interface import location URL
 java.lang.String getIntfNamespace()
          Returns the interface namespace
 javax.wsdl.Definition getIntfWSDL()
          Get a interface WSDL Definition for the current configuration parameters
 java.lang.String getLocationUrl()
          Returns the String representation of the service endpoint URL
 java.util.Map getNamespaceMap()
          get the packagename to namespace map
 TypeMappingRegistry getReg()
          Returns the TypeMappingRegistry used by the service
 java.lang.String getServiceName()
          Returns the String representation of the service URN
 java.lang.String getTargetService()
          Returns the target service name
 boolean getUseInheritedMethods()
           
 javax.wsdl.Definition getWSDL()
          Get a Full WSDL Definition for the current configuration parameters
 void setAllowedMethods(java.lang.String allowedMethods)
          Set a space separated list of methods to export
 void setCls(java.lang.Class cls)
          Sets the Class to export
 void setCls(java.lang.String className, java.lang.String classDir)
          Sets the Class to export
 void setDescription(java.lang.String description)
          Set the service description
 void setImplNamespace(java.lang.String ns)
          Set the implementation namespace
 void setImportUrl(java.lang.String importUrl)
          Set the String representation of the interface location URL for importing
 void setIntfNamespace(java.lang.String ns)
          Set the interface namespace
 void setLocationUrl(java.lang.String locationUrl)
          Set the String representation of the service endpoint URL
 void setNamespaceMap(java.util.Map map)
          Set the packagename to namespace map with the given map
 void setReg(TypeMappingRegistry reg)
          Sets the TypeMappingRegistry used by the service
 void setServiceName(java.lang.String serviceName)
          Set the String representation of the service URN
 void setTargetService(java.lang.String targetService)
          Set the target service name
 void setUseInheritedMethods(boolean useInheritedMethods)
           
 void writePartToMessage(javax.wsdl.Definition def, javax.wsdl.Message msg, java.lang.String name, java.lang.Class param)
          Create a Part
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_ALL

public static final int MODE_ALL

MODE_INTERFACE

public static final int MODE_INTERFACE

MODE_IMPLEMENTATION

public static final int MODE_IMPLEMENTATION
Constructor Detail

Emitter

public Emitter()
Construct Emitter. Set the contextual information using set* methods at the end of the class. Invoke emit to emit the code
Method Detail

emit

public void emit(java.lang.String filename1,
                 java.lang.String filename2)
          throws java.lang.Exception
Generates WSDL documents for a given Class
Parameters:
filename1 - interface WSDL
filename2 - implementation WSDL
Throws:
java.lang.Exception -  

emit

public void emit(java.lang.String filename)
          throws java.lang.Exception
Generates a complete WSDL document for a given Class
Parameters:
filename - WSDL
Throws:
java.lang.Exception -  

emit

public void emit(java.lang.String filename,
                 int mode)
          throws java.lang.Exception
Generates a WSDL document for a given Class. The sections of the WSDL generated are controlled by the mode parameter mode 0: All mode 1: Interface mode 2: Implementation
Parameters:
filename - WSDL
mode - generation mode - all, interface, implementation
Throws:
java.lang.Exception -  

getWSDL

public javax.wsdl.Definition getWSDL()
                              throws java.lang.Exception
Get a Full WSDL Definition for the current configuration parameters
Returns:
WSDL Definition
Throws:
java.lang.Exception -  

getIntfWSDL

public javax.wsdl.Definition getIntfWSDL()
                                  throws java.lang.Exception
Get a interface WSDL Definition for the current configuration parameters
Returns:
WSDL Definition
Throws:
java.lang.Exception -  

getImplWSDL

public javax.wsdl.Definition getImplWSDL()
                                  throws java.lang.Exception
Get implementation WSDL Definition for the current configuration parameters
Returns:
WSDL Definition
Throws:
java.lang.Exception -  

writePartToMessage

public void writePartToMessage(javax.wsdl.Definition def,
                               javax.wsdl.Message msg,
                               java.lang.String name,
                               java.lang.Class param)
                        throws java.lang.Exception
Create a Part
Parameters:
def -  
msg -  
name - String name of part
param - Class type of parameter
Throws:
java.lang.Exception -  

getCls

public java.lang.Class getCls()
Returns the Class to export
Returns:
the Class to export

setCls

public void setCls(java.lang.Class cls)
Sets the Class to export
Parameters:
cls - the Class to export

getIntfNamespace

public java.lang.String getIntfNamespace()
Returns the interface namespace
Returns:
interface target namespace

setIntfNamespace

public void setIntfNamespace(java.lang.String ns)
Set the interface namespace
Parameters:
ns - interface target namespace

getImplNamespace

public java.lang.String getImplNamespace()
Returns the implementation namespace
Returns:
implementation target namespace

setImplNamespace

public void setImplNamespace(java.lang.String ns)
Set the implementation namespace
Parameters:
ns - implementation target namespace

setCls

public void setCls(java.lang.String className,
                   java.lang.String classDir)
Sets the Class to export
Parameters:
className - the name of the Class to export
classDir - the directory containing the class (optional)

getAllowedMethods

public java.lang.String getAllowedMethods()
Returns a list of a space separated list of methods to export
Returns:
a space separated list of methods to export

setAllowedMethods

public void setAllowedMethods(java.lang.String allowedMethods)
Set a space separated list of methods to export
Parameters:
allowedMethods - a space separated list of methods to export

getUseInheritedMethods

public boolean getUseInheritedMethods()

setUseInheritedMethods

public void setUseInheritedMethods(boolean useInheritedMethods)

getNamespaceMap

public java.util.Map getNamespaceMap()
get the packagename to namespace map
Returns:
Map

setNamespaceMap

public void setNamespaceMap(java.util.Map map)
Set the packagename to namespace map with the given map
Parameters:
map - packagename/namespace Map

getLocationUrl

public java.lang.String getLocationUrl()
Returns the String representation of the service endpoint URL
Returns:
String representation of the service endpoint URL

setLocationUrl

public void setLocationUrl(java.lang.String locationUrl)
Set the String representation of the service endpoint URL
Parameters:
locationUrl - the String representation of the service endpoint URL

getImportUrl

public java.lang.String getImportUrl()
Returns the String representation of the interface import location URL
Returns:
String representation of the interface import location URL

setImportUrl

public void setImportUrl(java.lang.String importUrl)
Set the String representation of the interface location URL for importing
Parameters:
locationUrl - the String representation of the interface location URL for importing

getServiceName

public java.lang.String getServiceName()
Returns the String representation of the service URN
Returns:
String representation of the service URN

setServiceName

public void setServiceName(java.lang.String serviceName)
Set the String representation of the service URN
Parameters:
serviceUrn - the String representation of the service URN

getTargetService

public java.lang.String getTargetService()
Returns the target service name
Returns:
the target service name

setTargetService

public void setTargetService(java.lang.String targetService)
Set the target service name
Parameters:
targetService - the target service name

getDescription

public java.lang.String getDescription()
Returns the service description
Returns:
service description String

setDescription

public void setDescription(java.lang.String description)
Set the service description
Parameters:
description - service description String

getReg

public TypeMappingRegistry getReg()
Returns the TypeMappingRegistry used by the service
Returns:
the TypeMappingRegistry used by the service

setReg

public void setReg(TypeMappingRegistry reg)
Sets the TypeMappingRegistry used by the service
Parameters:
reg - the TypeMappingRegistry used by the service


Copyright © 2001 Apache XML Project. All Rights Reserved.