Package org.apache.axis.wsdl.toJava
Class Emitter
java.lang.Object
org.apache.axis.wsdl.gen.Parser
org.apache.axis.wsdl.toJava.Emitter
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
FieldsModifier and TypeFieldDescriptionprotected BaseTypeMapping
Field baseTypeMappingstatic final String
Field DEFAULT_NSTOPKG_FILEprotected HashMap
Field namespaceMapprotected Namespaces
Field namespacesprotected List
Field nsIncludes - defines a list of namespaces to specifically exclude from generated source code.protected List
Field nsIncludes - defines a list of namespaces to specifically include in the generated source code.protected String
Field NStoPkgFilenameprotected List
Field properties - defines a set of general purpose properties that can be used by custom JavaGeneratorFactories.protected String
Field typeMappingVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
debug
(boolean value) Deprecated.Use setDebug(value)void
deploySkeleton
(boolean value) Deprecated.Use setSkeletonWanted(value)protected boolean
Check if the className exists.void
Deprecated.Call run(uri) instead.void
Deprecated.Call run(context, doc) instead.void
generateAll
(boolean all) Deprecated.Use setAllWanted(all)void
generateImports
(boolean generateImports) Deprecated.Use setImports(generateImports)void
generateServerSide
(boolean value) Deprecated.Use setServerSide(value)void
generateTestCase
(boolean value) Deprecated.Use setTestCaseWanted()boolean
getDebug()
Deprecated.Use isDebug()Returns the defaultTypeMapping
used by the serviceboolean
Deprecated.Use isSkeletonWanted()This method returns a list of all generated class names.Returns an object which contains of information on all generated files including the class name, filename and a type string.This method returns a list of all generated file names.boolean
Deprecated.Use isServerSide()boolean
Deprecated.Use isHelperWanted()Get an implementation classname to use instead of the default.getJavaName
(QName qName) Convert the specified QName into a full Java Name.protected String
getJavaNameHook
(QName qname) getJavaVariableName
(QName typeQName, QName xmlName, boolean isElement) protected String
getJavaVariableNameHook
(QName typeQName, QName xmlName, boolean isElement) Returns the list of excludes to specifically exclude from the generated source.Returns the list of namespaces specifically excluded from the generated code.Get the map of namespace -> Java package namesMethod getNamespacesGet the output directory to use for emitted source filesgetPackage
(String namespace) Get the Package name for the specified namespacegetPackage
(QName qName) Get the Package name for the specified QNameGet global package name to use instead of mapping namespacesGets the list of extension properties for custom JavaGeneratorFactories.Get the type qname to java class mapgetScope()
Get the scope for the deploy.xml file.Retruns the SericeDesc objectGet the typemapping versionboolean
Deprecated.Use isVerbose()Deprecated.Call getFactory instead.boolean
boolean
Method isAllWantedboolean
get the build file genaeration stateboolean
isDeploy()
Returns the deploy mode flagboolean
Indicate if we should be generating Helper classesboolean
Indicate if we should be emitting server side code and deploy/undeployboolean
Indicate if we should be deploying skeleton or implementationboolean
Method isTestCaseWantedboolean
Get the type collision protection settingvoid
Emit appropriate Java files for a WSDL at a given URL.void
Call this method if your WSDL document has already been parsed as an XML DOM document.protected void
sanityCheck
(SymbolTable symbolTable) Method sanityCheckvoid
setAllowInvalidURL
(boolean allowInvalidURL) void
setAllWanted
(boolean all) By default, code is generated only for referenced elements.void
setBuildFileWanted
(boolean value) turn the build file genaration ONvoid
setDefaultTypeMapping
(TypeMapping defaultTM) Sets the defaultTypeMapping
used by the servicevoid
setDeploy
(boolean isDeploy) Sets the deploy mode flagvoid
setFactory
(String factory) Sets theWriterFactory Class
to usevoid
setHelperGeneration
(boolean value) Deprecated.Use setHelperWanted(value)void
setHelperWanted
(boolean value) Turn on/off Helper class generationvoid
setImplementationClassName
(String implementationClassName) Set an implementation classname to use instead of the default.void
setNamespaceExcludes
(List nsExcludes) Sets the list of namespaces to specifically exclude from the generated source.void
setNamespaceIncludes
(List nsIncludes) Sets the list of namespaces to specifically include in the generated code.void
setNamespaceMap
(HashMap map) Set a map of namespace -> Java package namesvoid
setNStoPkg
(String NStoPkgFilename) Set the NStoPkg mappings filename.void
setOutputDir
(String outputDir) Set the output directory to use in emitted source filesvoid
setPackageName
(String packageName) Set a global package name to use instead of mapping namespacesvoid
setProperties
(List properties) Sets the list of extension properties for custom JavaGeneratorFactories.void
setQName2ClassMap
(HashMap map) Set the type qname to java class mapvoid
Set the scope for the deploy.xml file.void
setServerSide
(boolean value) Turn on/off server skeleton creationvoid
setServiceDesc
(ServiceDesc serviceDesc) Sets the ServicdDesc objectvoid
setSkeletonWanted
(boolean value) Turn on/off server skeleton deployvoid
setTestCaseWanted
(boolean value) Turn on/off test case creationvoid
setTypeCollisionProtection
(boolean value) Enable/disable type collision protectionvoid
setTypeMappingVersion
(String typeMappingVersion) Method setTypeMappingVersionvoid
setWrapArrays
(boolean wrapArrays) void
verbose
(boolean value) Deprecated.Use setVerbose(value)Methods inherited from class org.apache.axis.wsdl.gen.Parser
getCurrentDefinition, getFactory, getPassword, getSymbolTable, getTimeout, getUsername, getWSDLURI, isDebug, isImports, isNowrap, isQuiet, isVerbose, setDebug, setFactory, setImports, setNowrap, setPassword, setQuiet, setTimeout, setUsername, setVerbose
-
Field Details
-
DEFAULT_NSTOPKG_FILE
Field DEFAULT_NSTOPKG_FILE- See Also:
-
namespaceMap
Field namespaceMap -
typeMappingVersion
Field typeMappingVersion -
baseTypeMapping
Field baseTypeMapping -
namespaces
Field namespaces -
NStoPkgFilename
Field NStoPkgFilename -
nsIncludes
Field nsIncludes - defines a list of namespaces to specifically include in the generated source code. If non-empty, anything not in this list should be excluded. If empty, everything in this and not specifically excluded should be generated. -
nsExcludes
Field nsIncludes - defines a list of namespaces to specifically exclude from generated source code. Any entry in this list that is in conflict with the includes list should be ignored and generated. -
properties
Field properties - defines a set of general purpose properties that can be used by custom JavaGeneratorFactories.
-
-
Constructor Details
-
Emitter
public Emitter()Default constructor.
-
-
Method Details
-
setServerSide
public void setServerSide(boolean value) Turn on/off server skeleton creation- Parameters:
value
-
-
isServerSide
public boolean isServerSide()Indicate if we should be emitting server side code and deploy/undeploy- Returns:
-
setSkeletonWanted
public void setSkeletonWanted(boolean value) Turn on/off server skeleton deploy- Parameters:
value
-
-
isSkeletonWanted
public boolean isSkeletonWanted()Indicate if we should be deploying skeleton or implementation- Returns:
-
setHelperWanted
public void setHelperWanted(boolean value) Turn on/off Helper class generation- Parameters:
value
-
-
isHelperWanted
public boolean isHelperWanted()Indicate if we should be generating Helper classes- Returns:
-
setTestCaseWanted
public void setTestCaseWanted(boolean value) Turn on/off test case creation- Parameters:
value
-
-
isTestCaseWanted
public boolean isTestCaseWanted()Method isTestCaseWanted- Returns:
-
isBuildFileWanted
public boolean isBuildFileWanted()get the build file genaeration state- Returns:
-
setBuildFileWanted
public void setBuildFileWanted(boolean value) turn the build file genaration ON- Parameters:
value
-
-
setAllWanted
public void setAllWanted(boolean all) By default, code is generated only for referenced elements. Call bGenerateAll(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.- Parameters:
all
-
-
isAllWanted
public boolean isAllWanted()Method isAllWanted- Returns:
-
getNamespaces
Method getNamespaces- Returns:
-
setOutputDir
Set the output directory to use in emitted source files- Parameters:
outputDir
-
-
getOutputDir
Get the output directory to use for emitted source files- Returns:
-
getPackageName
Get global package name to use instead of mapping namespaces- Returns:
-
setPackageName
Set a global package name to use instead of mapping namespaces- Parameters:
packageName
-
-
setScope
Set the scope for the deploy.xml file.- Parameters:
scope
- One of 'null', Scope.APPLICATION, Scope.REQUEST, Scope.SESSION. Anything else is equivalent to 'null' null and no explicit scope tag will appear in deploy.xml.
-
getScope
Get the scope for the deploy.xml file.- Returns:
-
setNStoPkg
Set the NStoPkg mappings filename.- Parameters:
NStoPkgFilename
-
-
setNamespaceMap
Set a map of namespace -> Java package names- Parameters:
map
-
-
getNamespaceMap
Get the map of namespace -> Java package names- Returns:
-
setNamespaceIncludes
Sets the list of namespaces to specifically include in the generated code. -
getNamespaceIncludes
Returns the list of namespaces specifically excluded from the generated code. -
setNamespaceExcludes
Sets the list of namespaces to specifically exclude from the generated source. -
getNamespaceExcludes
Returns the list of excludes to specifically exclude from the generated source. -
setProperties
Sets the list of extension properties for custom JavaGeneratorFactories. -
getProperties
Gets the list of extension properties for custom JavaGeneratorFactories. -
getDefaultTypeMapping
Returns the defaultTypeMapping
used by the service- Returns:
- the default
TypeMapping
used by the service
-
setDefaultTypeMapping
Sets the defaultTypeMapping
used by the service- Parameters:
defaultTM
- the defaultTypeMapping
used by the service
-
setFactory
Sets theWriterFactory Class
to use- Parameters:
factory
- the name of the factoryClass
-
getGeneratedFileInfo
Returns an object which contains of information on all generated files including the class name, filename and a type string.- Returns:
- An org.apache.axis.wsdl.toJava.GeneratedFileInfo object
- See Also:
-
getGeneratedClassNames
This method returns a list of all generated class names.- Returns:
-
getGeneratedFileNames
This method returns a list of all generated file names.- Returns:
-
getPackage
Get the Package name for the specified namespace- Parameters:
namespace
-- Returns:
-
getPackage
Get the Package name for the specified QName- Parameters:
qName
-- Returns:
-
getJavaName
Convert the specified QName into a full Java Name.- Parameters:
qName
-- Returns:
-
getJavaNameHook
-
getJavaVariableName
- Parameters:
typeQName
- QName for containing xml typexmlName
- QName for element- Returns:
-
getJavaVariableNameHook
-
run
Emit appropriate Java files for a WSDL at a given URL. This method will time out after the number of milliseconds specified by our timeoutms member. -
run
public void run(String context, Document doc) throws IOException, SAXException, javax.wsdl.WSDLException, ParserConfigurationException Call this method if your WSDL document has already been parsed as an XML DOM document.- Overrides:
run
in classParser
- Parameters:
context
- 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.doc
- doc This is the XML Document containing the WSDL.- Throws:
IOException
SAXException
javax.wsdl.WSDLException
ParserConfigurationException
-
sanityCheck
Method sanityCheck- Overrides:
sanityCheck
in classParser
- Parameters:
symbolTable
-
-
getTypeMappingVersion
Get the typemapping version -
setTypeMappingVersion
Method setTypeMappingVersion- Parameters:
typeMappingVersion
-
-
getWriterFactory
Deprecated.Call getFactory instead. This doesn't return a WriterFactory, it returns a GeneratorFactory.Get the GeneratorFactory.- Returns:
-
emit
Deprecated.Call run(uri) instead.Call this method if you have a uri for the WSDL document- Parameters:
uri
- wsdlURI the location of the WSDL file.- Throws:
Exception
-
emit
public void emit(String context, Document doc) throws IOException, SAXException, javax.wsdl.WSDLException, ParserConfigurationException Deprecated.Call run(context, doc) instead.Call this method if your WSDL document has already been parsed as an XML DOM document.- Parameters:
context
- 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.doc
- doc This is the XML Document containing the WSDL.- Throws:
IOException
SAXException
javax.wsdl.WSDLException
ParserConfigurationException
-
generateServerSide
public void generateServerSide(boolean value) Deprecated.Use setServerSide(value)Turn on/off server-side binding generation- Parameters:
value
-
-
getGenerateServerSide
public boolean getGenerateServerSide()Deprecated.Use isServerSide()Indicate if we should be emitting server side code and deploy/undeploy- Returns:
-
deploySkeleton
public void deploySkeleton(boolean value) Deprecated.Use setSkeletonWanted(value)Turn on/off server skeleton deploy- Parameters:
value
-
-
getDeploySkeleton
public boolean getDeploySkeleton()Deprecated.Use isSkeletonWanted()Indicate if we should be deploying skeleton or implementation- Returns:
-
setHelperGeneration
public void setHelperGeneration(boolean value) Deprecated.Use setHelperWanted(value)Turn on/off Helper class generation- Parameters:
value
-
-
getHelperGeneration
public boolean getHelperGeneration()Deprecated.Use isHelperWanted()Indicate if we should be generating Helper classes- Returns:
-
generateImports
public void generateImports(boolean generateImports) Deprecated.Use setImports(generateImports)Turn on/off generation of elements from imported files.- Parameters:
generateImports
-
-
debug
public void debug(boolean value) Deprecated.Use setDebug(value)Turn on/off debug messages.- Parameters:
value
-
-
getDebug
public boolean getDebug()Deprecated.Use isDebug()Return the status of the debug switch.- Returns:
-
verbose
public void verbose(boolean value) Deprecated.Use setVerbose(value)Turn on/off verbose messages- Parameters:
value
-
-
getVerbose
public boolean getVerbose()Deprecated.Use isVerbose()Return the status of the verbose switch- Returns:
-
generateTestCase
public void generateTestCase(boolean value) Deprecated.Use setTestCaseWanted()Turn on/off test case creation- Parameters:
value
-
-
generateAll
public void generateAll(boolean all) Deprecated.Use setAllWanted(all)- Parameters:
all
-
-
isTypeCollisionProtection
public boolean isTypeCollisionProtection()Get the type collision protection setting- Returns:
-
setTypeCollisionProtection
public void setTypeCollisionProtection(boolean value) Enable/disable type collision protection- Parameters:
value
-
-
getImplementationClassName
Get an implementation classname to use instead of the default.- Returns:
-
setImplementationClassName
Set an implementation classname to use instead of the default.- Parameters:
implementationClassName
-
-
isAllowInvalidURL
public boolean isAllowInvalidURL()- Returns:
- Returns the allowInvalidURL.
-
setAllowInvalidURL
public void setAllowInvalidURL(boolean allowInvalidURL) - Parameters:
allowInvalidURL
- The allowInvalidURL to set.
-
setQName2ClassMap
Set the type qname to java class map- Parameters:
map
- a type qname to javaclass map (from Java2Wsdl emitter)
-
getQName2ClassMap
Get the type qname to java class map- Returns:
- the type qname to java class map
-
getServiceDesc
Retruns the SericeDesc object- Returns:
-
setServiceDesc
Sets the ServicdDesc object- Parameters:
serviceDesc
- ServiceDesc to set
-
isDeploy
public boolean isDeploy()Returns the deploy mode flag- Returns:
-
setDeploy
public void setDeploy(boolean isDeploy) Sets the deploy mode flag- Parameters:
isDeploy
- deploy mode flag
-
doesExist
Check if the className exists.- Parameters:
className
- className to check- Returns:
- true if exists, false if not
-
setWrapArrays
public void setWrapArrays(boolean wrapArrays)
-