org.apache.axis.wsdl.toJava
Class Emitter

java.lang.Object
  |
  +--org.apache.axis.wsdl.toJava.Emitter

public class Emitter
extends java.lang.Object

This class produces java files for stubs, skeletons, and types from a WSDL document.

Author:
Russell Butek (butek@us.ibm.com), Tom Jordahl (tjordahl@macromedia.com), Rich Scheuerle (scheu@us.ibm.com), Steve Graham (sggraham@us.ibm.com)

Field Summary
static byte APPLICATION_SCOPE
           
protected  boolean bDebug
           
protected  boolean bDeploySkeleton
           
protected  boolean bEmitServer
           
protected  boolean bEmitTestCase
           
protected  boolean bGenerateAll
           
protected  boolean bGenerateImports
           
protected  boolean bVerbose
           
protected  java.lang.String currentWSDLURI
           
protected  javax.wsdl.Definition def
           
protected  java.util.HashMap delaySetMap
           
protected  org.w3c.dom.Document doc
           
protected  GeneratedFileInfo fileInfo
           
protected  Namespaces namespaces
           
static byte NO_EXPLICIT_SCOPE
           
protected  java.io.File NStoPkgFile
           
protected  java.lang.String NStoPkgFilename
           
protected  java.lang.String outputDir
           
protected  java.lang.String packageName
           
static byte REQUEST_SCOPE
           
protected  byte scope
           
static byte SESSION_SCOPE
           
protected  SymbolTable symbolTable
           
protected  WriterFactory writerFactory
           
 
Constructor Summary
Emitter(WriterFactory writerFactory)
          Default constructor.
 
Method Summary
 void debug(boolean value)
          Turn on/off debug messages.
 void deploySkeleton(boolean value)
          Turn on/off server skeleton deploy
 void emit(java.lang.String uri)
          Call this method if you have a uri for the WSDL document
 void emit(java.lang.String context, org.w3c.dom.Document doc)
          Call this method if your WSDL document has already been parsed as an XML DOM document.
 void generateAll(boolean all)
          By default, code is generated only for referenced elements.
 void generateImports(boolean generateImports)
          Turn on/off generation of elements from imported files.
 void generateServerSide(boolean value)
          Turn on/off server skeleton creation
 void generateTestCase(boolean value)
          Turn on/off test case creation
 javax.wsdl.Definition getCurrentDefinition()
          Return the current definition
 boolean getDebug()
          Return the status of the debug switch.
 boolean getDeploySkeleton()
          Indicate if we should be deploying skeleton or implementation
 java.util.List getGeneratedClassNames()
          This method returns a list of all generated class names.
 GeneratedFileInfo getGeneratedFileInfo()
          This method returns an object which contains of all generated files including the class name, filename and a type string.
 java.util.List getGeneratedFileNames()
          This method returns a list of all generated file names.
 boolean getGenerateServerSide()
          Indicate if we should be emitting server side code and deploy/undeploy
 java.util.HashMap getNamespaceMap()
          Get the map of namespace -> Java package names
 Namespaces getNamespaces()
           
 java.lang.String getOutputDir()
          Get the output directory to use for emitted source files
 java.lang.String getPackageName()
          Get global package name to use instead of mapping namespaces
 byte getScope()
          Get the scope for the deploy.xml file.
 SymbolTable getSymbolTable()
           
 boolean getVerbose()
          Return the status of the verbose switch
 java.lang.String getWSDLURI()
           
static void main(java.lang.String[] args)
           
 void setNamespaceMap(java.util.HashMap map)
          Set a map of namespace -> Java package names
 void setNStoPkg(java.io.File NStoPkgFile)
          set the package to namespace mappings file
 void setNStoPkg(java.lang.String NStoPkgFilename)
          set the package to namespace mappings filename
 void setOutputDir(java.lang.String outputDir)
          Set the output directory to use in emitted source files
 void setPackageName(java.lang.String packageName)
          Set a global package name to use instead of mapping namespaces
 void setScope(byte scope)
          Set the scope for the deploy.xml file.
 void verbose(boolean value)
          Turn on/off verbose messages
protected  void writeTypes()
          Generate bindings (classes and class holders) for the complex types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_EXPLICIT_SCOPE

public static final byte NO_EXPLICIT_SCOPE

APPLICATION_SCOPE

public static final byte APPLICATION_SCOPE

REQUEST_SCOPE

public static final byte REQUEST_SCOPE

SESSION_SCOPE

public static final byte SESSION_SCOPE

doc

protected org.w3c.dom.Document doc

def

protected javax.wsdl.Definition def

bDebug

protected boolean bDebug

bEmitServer

protected boolean bEmitServer

bDeploySkeleton

protected boolean bDeploySkeleton

bEmitTestCase

protected boolean bEmitTestCase

bVerbose

protected boolean bVerbose

bGenerateImports

protected boolean bGenerateImports

bGenerateAll

protected boolean bGenerateAll

outputDir

protected java.lang.String outputDir

packageName

protected java.lang.String packageName

scope

protected byte scope

fileInfo

protected GeneratedFileInfo fileInfo

namespaces

protected Namespaces namespaces

delaySetMap

protected java.util.HashMap delaySetMap

writerFactory

protected WriterFactory writerFactory

symbolTable

protected SymbolTable symbolTable

currentWSDLURI

protected java.lang.String currentWSDLURI

NStoPkgFilename

protected java.lang.String NStoPkgFilename

NStoPkgFile

protected java.io.File NStoPkgFile
Constructor Detail

Emitter

public Emitter(WriterFactory writerFactory)
Default constructor.
Method Detail

getSymbolTable

public SymbolTable getSymbolTable()

emit

public void emit(java.lang.String uri)
          throws java.io.IOException,
                 javax.wsdl.WSDLException
Call this method if you have a uri for the WSDL document
Parameters:
String - wsdlURI the location of the WSDL file.

emit

public void emit(java.lang.String context,
                 org.w3c.dom.Document doc)
          throws java.io.IOException,
                 javax.wsdl.WSDLException
Call this method if your WSDL document has already been parsed as an XML DOM document.
Parameters:
String - context This is directory context for the Document. If the Document were from file "/x/y/z.wsdl" then the context could be "/x/y" (even "/x/y/z.wsdl" would work). If context is null, then the context becomes the current directory.
Document - doc This is the XML Document containing the WSDL.

generateServerSide

public void generateServerSide(boolean value)
Turn on/off server skeleton creation
Parameters:
boolean - value

getGenerateServerSide

public boolean getGenerateServerSide()
Indicate if we should be emitting server side code and deploy/undeploy

deploySkeleton

public void deploySkeleton(boolean value)
Turn on/off server skeleton deploy
Parameters:
boolean - value

getDeploySkeleton

public boolean getDeploySkeleton()
Indicate if we should be deploying skeleton or implementation

generateTestCase

public void generateTestCase(boolean value)
Turn on/off test case creation
Parameters:
boolean - value

getCurrentDefinition

public javax.wsdl.Definition getCurrentDefinition()
Return the current definition

generateImports

public void generateImports(boolean generateImports)
Turn on/off generation of elements from imported files.
Parameters:
boolean - generateImports

generateAll

public void generateAll(boolean all)
By default, code is generated only for referenced elements. Call generateAll(true) and WSDL2Java will generate code for all elements in the scope regardless of whether they are referenced. Scope means: by default, all WSDL files; if generateImports(false), then only the immediate WSDL file.

debug

public void debug(boolean value)
Turn on/off debug messages.
Parameters:
boolean - value

getDebug

public boolean getDebug()
Return the status of the debug switch.

verbose

public void verbose(boolean value)
Turn on/off verbose messages
Parameters:
boolean - value

getVerbose

public boolean getVerbose()
Return the status of the verbose switch

setNamespaceMap

public void setNamespaceMap(java.util.HashMap map)
Set a map of namespace -> Java package names

getNamespaceMap

public java.util.HashMap getNamespaceMap()
Get the map of namespace -> Java package names

setOutputDir

public void setOutputDir(java.lang.String outputDir)
Set the output directory to use in emitted source files

getPackageName

public java.lang.String getPackageName()
Get global package name to use instead of mapping namespaces

setPackageName

public void setPackageName(java.lang.String packageName)
Set a global package name to use instead of mapping namespaces

getOutputDir

public java.lang.String getOutputDir()
Get the output directory to use for emitted source files

setScope

public void setScope(byte scope)
Set the scope for the deploy.xml file.
Parameters:
scope - One of Emitter.NO_EXPLICIT_SCOPE, Emitter.APPLICATION_SCOPE, Emitter.REQUEST_SCOPE, Emitter.SESSION_SCOPE. Anything else is equivalent to NO_EXPLICIT_SCOPE and no explicit scope tag will appear in deploy.xml.

getScope

public byte getScope()
Get the scope for the deploy.xml file.

setNStoPkg

public void setNStoPkg(java.lang.String NStoPkgFilename)
set the package to namespace mappings filename

setNStoPkg

public void setNStoPkg(java.io.File NStoPkgFile)
set the package to namespace mappings file

getGeneratedClassNames

public java.util.List getGeneratedClassNames()
This method returns a list of all generated class names.

getGeneratedFileNames

public java.util.List getGeneratedFileNames()
This method returns a list of all generated file names.

getGeneratedFileInfo

public GeneratedFileInfo getGeneratedFileInfo()
This method returns an object which contains of all generated files including the class name, filename and a type string.

writeTypes

protected void writeTypes()
                   throws java.io.IOException
Generate bindings (classes and class holders) for the complex types. If generating serverside (skeleton) spit out beanmappings

getNamespaces

public Namespaces getNamespaces()

getWSDLURI

public java.lang.String getWSDLURI()

main

public static void main(java.lang.String[] args)


Copyright © 2001 Apache XML Project. All Rights Reserved.