org.codehaus.xfire.wsdl
Class AbstractWSDL

java.lang.Object
  extended by org.codehaus.xfire.wsdl.AbstractWSDL
All Implemented Interfaces:
WSDLWriter
Direct Known Subclasses:
WSDLBuilder

public abstract class AbstractWSDL
extends java.lang.Object
implements WSDLWriter

Provides schema functionality for a WSDLBuilder.

Author:
Dan Diephouse

Field Summary
static java.lang.String CLEAN_IMPORTS
           
static java.lang.String GENERATE_IMPORTS
           
static java.lang.String REMOVE_ALL_IMPORTS
           
protected  java.util.Map typeMap
           
static org.jdom.Namespace XSD_NS
           
 
Fields inherited from interface org.codehaus.xfire.wsdl.WSDLWriter
WSDL11_NS, WSDL11_SOAP_NS
 
Constructor Summary
AbstractWSDL(Service service)
           
 
Method Summary
 void addDependency(SchemaType type)
           
 void addNamespace(java.lang.String prefix, java.lang.String uri)
           
 void addNamespaceImport(java.lang.String uri, java.lang.String imported)
          Adds an import to another namespace.
 void addSchema(java.lang.String location)
          Loads a schema off the filesystem or the classpath and adds it to the WSDL types section.
 void addSchemas(java.util.List schemaLocations)
           
 void cleanImport(org.jdom.Element node)
           
protected  void cleanImports()
           
protected  void cleanImports(org.jdom.Document schema)
          Removes the schemaLocation attribute from an <xsd:import> statement.
 org.jdom.Element createSchemaType(java.lang.String namespace)
          Create a shcema type element and store it to be written later on.
 org.jdom.Element getImport(org.jdom.Element schema, java.lang.String ns)
           
 java.lang.String getNamespacePrefix(java.lang.String uri)
           
protected  org.jdom.Element getSchemaTypes()
           
 Service getService()
           
 java.lang.String getTargetNamespace()
           
protected  boolean hasDependency(SchemaType type)
           
protected  boolean hasSchema(java.lang.String namespace)
           
protected  void initialize()
           
 boolean isSchemaLocationRemoved()
           
protected  void removeAllImports()
          Removes imports from all the schemas.
protected  void removeImports(org.jdom.Element schema)
           
protected  void setSchema(java.lang.String namespace, org.jdom.Element schema)
           
 void setSchemaLocationRemoved(boolean schemaLocationRemoved)
           
protected  void setSchemaTypes(org.jdom.Element schemaTypes)
           
 void setService(Service service)
           
protected  void updateImports()
           
abstract  void write(java.io.OutputStream out)
          Write the WSDL to an OutputStream.
protected abstract  void writeComplexTypes()
           
protected  void writeImports()
          Write xs:import elements for each schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeMap

protected java.util.Map typeMap

XSD_NS

public static final org.jdom.Namespace XSD_NS

GENERATE_IMPORTS

public static final java.lang.String GENERATE_IMPORTS
See Also:
Constant Field Values

CLEAN_IMPORTS

public static final java.lang.String CLEAN_IMPORTS
See Also:
Constant Field Values

REMOVE_ALL_IMPORTS

public static final java.lang.String REMOVE_ALL_IMPORTS
See Also:
Constant Field Values
Constructor Detail

AbstractWSDL

public AbstractWSDL(Service service)
             throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException
Method Detail

initialize

protected void initialize()

updateImports

protected void updateImports()
                      throws javax.wsdl.WSDLException
Throws:
javax.wsdl.WSDLException

writeImports

protected void writeImports()
Write xs:import elements for each schema.


getImport

public org.jdom.Element getImport(org.jdom.Element schema,
                                  java.lang.String ns)

removeAllImports

protected void removeAllImports()
Removes imports from all the schemas.


removeImports

protected void removeImports(org.jdom.Element schema)

cleanImports

protected void cleanImports()

cleanImport

public void cleanImport(org.jdom.Element node)

writeComplexTypes

protected abstract void writeComplexTypes()

addDependency

public void addDependency(SchemaType type)

hasDependency

protected boolean hasDependency(SchemaType type)

addNamespaceImport

public void addNamespaceImport(java.lang.String uri,
                               java.lang.String imported)
Adds an import to another namespace.

Parameters:
uri - The namespace to import into.
imported - The namespace to import.

write

public abstract void write(java.io.OutputStream out)
                    throws java.io.IOException
Description copied from interface: WSDLWriter
Write the WSDL to an OutputStream.

Specified by:
write in interface WSDLWriter
Parameters:
out - The OutputStream.
Throws:
java.io.IOException

addNamespace

public void addNamespace(java.lang.String prefix,
                         java.lang.String uri)

getNamespacePrefix

public java.lang.String getNamespacePrefix(java.lang.String uri)

getService

public Service getService()

setService

public void setService(Service service)

getTargetNamespace

public java.lang.String getTargetNamespace()

addSchemas

public void addSchemas(java.util.List schemaLocations)

addSchema

public void addSchema(java.lang.String location)
Loads a schema off the filesystem or the classpath and adds it to the WSDL types section.

Parameters:
location -

isSchemaLocationRemoved

public boolean isSchemaLocationRemoved()

setSchemaLocationRemoved

public void setSchemaLocationRemoved(boolean schemaLocationRemoved)

cleanImports

protected void cleanImports(org.jdom.Document schema)
Removes the schemaLocation attribute from an <xsd:import> statement.

Parameters:
schema -

createSchemaType

public org.jdom.Element createSchemaType(java.lang.String namespace)
Create a shcema type element and store it to be written later on.

Parameters:
namespace - The namespace to create the type in.
Returns:

hasSchema

protected boolean hasSchema(java.lang.String namespace)

setSchema

protected void setSchema(java.lang.String namespace,
                         org.jdom.Element schema)

getSchemaTypes

protected org.jdom.Element getSchemaTypes()

setSchemaTypes

protected void setSchemaTypes(org.jdom.Element schemaTypes)


Copyright © 2004-2009. All Rights Reserved.