public class Emitter extends Parser
Modifier and Type | Field and Description |
---|---|
protected BaseTypeMapping |
baseTypeMapping
Field baseTypeMapping
|
static java.lang.String |
DEFAULT_NSTOPKG_FILE
Field DEFAULT_NSTOPKG_FILE
|
protected java.util.HashMap |
namespaceMap
Field namespaceMap
|
protected Namespaces |
namespaces
Field namespaces
|
protected java.util.List |
nsExcludes
Field nsIncludes - defines a list of namespaces to specifically
exclude from generated source code.
|
protected java.util.List |
nsIncludes
Field nsIncludes - defines a list of namespaces to specifically
include in the generated source code.
|
protected java.lang.String |
NStoPkgFilename
Field NStoPkgFilename
|
protected java.util.List |
properties
Field properties - defines a set of general purpose properties
that can be used by custom JavaGeneratorFactories.
|
protected java.lang.String |
typeMappingVersion
Field typeMappingVersion
|
Constructor and Description |
---|
Emitter()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(boolean value)
Deprecated.
Use setDebug(value)
|
void |
deploySkeleton(boolean value)
Deprecated.
Use setSkeletonWanted(value)
|
protected boolean |
doesExist(java.lang.String className)
Check if the className exists.
|
void |
emit(java.lang.String uri)
Deprecated.
Call run(uri) instead.
|
void |
emit(java.lang.String context,
org.w3c.dom.Document doc)
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()
|
TypeMapping |
getDefaultTypeMapping()
Returns the default
TypeMapping used by the service |
boolean |
getDeploySkeleton()
Deprecated.
Use isSkeletonWanted()
|
java.util.List |
getGeneratedClassNames()
This method returns a list of all generated class names.
|
GeneratedFileInfo |
getGeneratedFileInfo()
Returns an object which contains of information on 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()
Deprecated.
Use isServerSide()
|
boolean |
getHelperGeneration()
Deprecated.
Use isHelperWanted()
|
java.lang.String |
getImplementationClassName()
Get an implementation classname to use instead of the default.
|
java.lang.String |
getJavaName(QName qName)
Convert the specified QName into a full Java Name.
|
protected java.lang.String |
getJavaNameHook(QName qname) |
java.lang.String |
getJavaVariableName(QName typeQName,
QName xmlName,
boolean isElement) |
protected java.lang.String |
getJavaVariableNameHook(QName typeQName,
QName xmlName,
boolean isElement) |
java.util.List |
getNamespaceExcludes()
Returns the list of excludes to specifically exclude
from the generated source.
|
java.util.List |
getNamespaceIncludes()
Returns the list of namespaces specifically excluded
from the generated code.
|
java.util.HashMap |
getNamespaceMap()
Get the map of namespace -> Java package names
|
Namespaces |
getNamespaces()
Method getNamespaces
|
java.lang.String |
getOutputDir()
Get the output directory to use for emitted source files
|
java.lang.String |
getPackage(QName qName)
Get the Package name for the specified QName
|
java.lang.String |
getPackage(java.lang.String namespace)
Get the Package name for the specified namespace
|
java.lang.String |
getPackageName()
Get global package name to use instead of mapping namespaces
|
java.util.List |
getProperties()
Gets the list of extension properties for custom
JavaGeneratorFactories.
|
java.util.HashMap |
getQName2ClassMap()
Get the type qname to java class map
|
Scope |
getScope()
Get the scope for the deploy.xml file.
|
ServiceDesc |
getServiceDesc()
Retruns the SericeDesc object
|
java.lang.String |
getTypeMappingVersion()
Get the typemapping version
|
boolean |
getVerbose()
Deprecated.
Use isVerbose()
|
GeneratorFactory |
getWriterFactory()
Deprecated.
Call getFactory instead. This doesn't return
a WriterFactory, it returns a GeneratorFactory.
|
boolean |
isAllowInvalidURL() |
boolean |
isAllWanted()
Method isAllWanted
|
boolean |
isBuildFileWanted()
get the build file genaeration state
|
boolean |
isDeploy()
Returns the deploy mode flag
|
boolean |
isHelperWanted()
Indicate if we should be generating Helper classes
|
boolean |
isServerSide()
Indicate if we should be emitting server side code and deploy/undeploy
|
boolean |
isSkeletonWanted()
Indicate if we should be deploying skeleton or implementation
|
boolean |
isTestCaseWanted()
Method isTestCaseWanted
|
boolean |
isTypeCollisionProtection()
Get the type collision protection setting
|
void |
run(java.lang.String wsdlURL)
Emit appropriate Java files for a WSDL at a given URL.
|
void |
run(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.
|
protected void |
sanityCheck(SymbolTable symbolTable)
Method sanityCheck
|
void |
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 ON
|
void |
setDefaultTypeMapping(TypeMapping defaultTM)
Sets the default
TypeMapping used by the service |
void |
setDeploy(boolean isDeploy)
Sets the deploy mode flag
|
void |
setFactory(java.lang.String factory)
Sets the
WriterFactory Class to use |
void |
setHelperGeneration(boolean value)
Deprecated.
Use setHelperWanted(value)
|
void |
setHelperWanted(boolean value)
Turn on/off Helper class generation
|
void |
setImplementationClassName(java.lang.String implementationClassName)
Set an implementation classname to use instead of the default.
|
void |
setNamespaceExcludes(java.util.List nsExcludes)
Sets the list of namespaces to specifically exclude
from the generated source.
|
void |
setNamespaceIncludes(java.util.List nsIncludes)
Sets the list of namespaces to specifically include
in the generated code.
|
void |
setNamespaceMap(java.util.HashMap map)
Set a map of namespace -> Java package names
|
void |
setNStoPkg(java.lang.String NStoPkgFilename)
Set the NStoPkg 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 |
setProperties(java.util.List properties)
Sets the list of extension properties for custom
JavaGeneratorFactories.
|
void |
setQName2ClassMap(java.util.HashMap map)
Set the type qname to java class map
|
void |
setScope(Scope scope)
Set the scope for the deploy.xml file.
|
void |
setServerSide(boolean value)
Turn on/off server skeleton creation
|
void |
setServiceDesc(ServiceDesc serviceDesc)
Sets the ServicdDesc object
|
void |
setSkeletonWanted(boolean value)
Turn on/off server skeleton deploy
|
void |
setTestCaseWanted(boolean value)
Turn on/off test case creation
|
void |
setTypeCollisionProtection(boolean value)
Enable/disable type collision protection
|
void |
setTypeMappingVersion(java.lang.String typeMappingVersion)
Method setTypeMappingVersion
|
void |
setWrapArrays(boolean wrapArrays) |
void |
verbose(boolean value)
Deprecated.
Use setVerbose(value)
|
getCurrentDefinition, getFactory, getPassword, getSymbolTable, getTimeout, getUsername, getWSDLURI, isDebug, isImports, isNowrap, isQuiet, isVerbose, setDebug, setFactory, setImports, setNowrap, setPassword, setQuiet, setTimeout, setUsername, setVerbose
public static final java.lang.String DEFAULT_NSTOPKG_FILE
protected java.util.HashMap namespaceMap
protected java.lang.String typeMappingVersion
protected BaseTypeMapping baseTypeMapping
protected Namespaces namespaces
protected java.lang.String NStoPkgFilename
protected java.util.List nsIncludes
protected java.util.List nsExcludes
protected java.util.List properties
public void setServerSide(boolean value)
value
- public boolean isServerSide()
public void setSkeletonWanted(boolean value)
value
- public boolean isSkeletonWanted()
public void setHelperWanted(boolean value)
value
- public boolean isHelperWanted()
public void setTestCaseWanted(boolean value)
value
- public boolean isTestCaseWanted()
public boolean isBuildFileWanted()
public void setBuildFileWanted(boolean value)
value
- public void setAllWanted(boolean all)
all
- public boolean isAllWanted()
public Namespaces getNamespaces()
public void setOutputDir(java.lang.String outputDir)
outputDir
- public java.lang.String getOutputDir()
public java.lang.String getPackageName()
public void setPackageName(java.lang.String packageName)
packageName
- public void setScope(Scope scope)
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.public Scope getScope()
public void setNStoPkg(java.lang.String NStoPkgFilename)
NStoPkgFilename
- public void setNamespaceMap(java.util.HashMap map)
map
- public java.util.HashMap getNamespaceMap()
public void setNamespaceIncludes(java.util.List nsIncludes)
public java.util.List getNamespaceIncludes()
public void setNamespaceExcludes(java.util.List nsExcludes)
public java.util.List getNamespaceExcludes()
public void setProperties(java.util.List properties)
public java.util.List getProperties()
public TypeMapping getDefaultTypeMapping()
TypeMapping
used by the serviceTypeMapping
used by the servicepublic void setDefaultTypeMapping(TypeMapping defaultTM)
TypeMapping
used by the servicedefaultTM
- the default TypeMapping
used by the servicepublic void setFactory(java.lang.String factory)
WriterFactory Class
to usefactory
- the name of the factory Class
public GeneratedFileInfo getGeneratedFileInfo()
GeneratedFileInfo
public java.util.List getGeneratedClassNames()
public java.util.List getGeneratedFileNames()
public java.lang.String getPackage(java.lang.String namespace)
namespace
- public java.lang.String getPackage(QName qName)
qName
- public java.lang.String getJavaName(QName qName)
qName
- protected java.lang.String getJavaNameHook(QName qname)
public java.lang.String getJavaVariableName(QName typeQName, QName xmlName, boolean isElement)
typeQName
- QName for containing xml typexmlName
- QName for elementprotected java.lang.String getJavaVariableNameHook(QName typeQName, QName xmlName, boolean isElement)
public void run(java.lang.String wsdlURL) throws java.lang.Exception
public void run(java.lang.String context, org.w3c.dom.Document doc) throws java.io.IOException, org.xml.sax.SAXException, WSDLException, javax.xml.parsers.ParserConfigurationException
run
in class Parser
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.java.io.IOException
org.xml.sax.SAXException
WSDLException
javax.xml.parsers.ParserConfigurationException
protected void sanityCheck(SymbolTable symbolTable)
sanityCheck
in class Parser
symbolTable
- public java.lang.String getTypeMappingVersion()
public void setTypeMappingVersion(java.lang.String typeMappingVersion)
typeMappingVersion
- public GeneratorFactory getWriterFactory()
public void emit(java.lang.String uri) throws java.lang.Exception
uri
- wsdlURI the location of the WSDL file.java.lang.Exception
public void emit(java.lang.String context, org.w3c.dom.Document doc) throws java.io.IOException, org.xml.sax.SAXException, WSDLException, javax.xml.parsers.ParserConfigurationException
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.java.io.IOException
org.xml.sax.SAXException
WSDLException
javax.xml.parsers.ParserConfigurationException
public void generateServerSide(boolean value)
value
- public boolean getGenerateServerSide()
public void deploySkeleton(boolean value)
value
- public boolean getDeploySkeleton()
public void setHelperGeneration(boolean value)
value
- public boolean getHelperGeneration()
public void generateImports(boolean generateImports)
generateImports
- public void debug(boolean value)
value
- public boolean getDebug()
public void verbose(boolean value)
value
- public boolean getVerbose()
public void generateTestCase(boolean value)
value
- public void generateAll(boolean all)
all
- public boolean isTypeCollisionProtection()
public void setTypeCollisionProtection(boolean value)
value
- public java.lang.String getImplementationClassName()
public void setImplementationClassName(java.lang.String implementationClassName)
implementationClassName
- public boolean isAllowInvalidURL()
public void setAllowInvalidURL(boolean allowInvalidURL)
allowInvalidURL
- The allowInvalidURL to set.public void setQName2ClassMap(java.util.HashMap map)
map
- a type qname to javaclass map (from Java2Wsdl emitter)public java.util.HashMap getQName2ClassMap()
public ServiceDesc getServiceDesc()
public void setServiceDesc(ServiceDesc serviceDesc)
serviceDesc
- ServiceDesc to setpublic boolean isDeploy()
public void setDeploy(boolean isDeploy)
isDeploy
- deploy mode flagprotected boolean doesExist(java.lang.String className)
className
- className to checkpublic void setWrapArrays(boolean wrapArrays)