com.sun.xml.ws.api.server
Interface SDDocument

All Known Subinterfaces:
SDDocument.Schema, SDDocument.WSDL
All Known Implementing Classes:
MetadataDocument, SDDocumentImpl

public interface SDDocument

Represents an individual document that forms a ServiceDefinition.

 TODO:
      how does those documents refer to each other?

 


Nested Class Summary
static interface SDDocument.Schema
          SDDocument that represents an XML Schema.
static interface SDDocument.WSDL
          SDDocument that represents a WSDL.
 
Method Summary
 Set<String> getImports()
          returns the referenced documents
 QName getRootName()
          Gets the root tag name of this document.
 URL getURL()
          Gets the system ID of the document where it's taken from.
 boolean isSchema()
          Returns true if this document is schema.
 boolean isWSDL()
          Returns true if this document is WSDL.
 void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, OutputStream os)
          Writes the document to the given OutputStream.
 void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, javax.xml.stream.XMLStreamWriter out)
          Writes the document to the given XMLStreamWriter.
 

Method Detail

getRootName

QName getRootName()
Gets the root tag name of this document.

This can be used to identify a kind of document quickly (such as schema, WSDL, ...)

Returns:
always non-null.

isWSDL

boolean isWSDL()
Returns true if this document is WSDL.


isSchema

boolean isSchema()
Returns true if this document is schema.


getImports

Set<String> getImports()
returns the referenced documents


getURL

URL getURL()
Gets the system ID of the document where it's taken from. Generated documents use a fake URL that can be used to resolve relative URLs. So donot use this URL for reading or writing.


writeTo

void writeTo(@Nullable
             PortAddressResolver portAddressResolver,
             DocumentAddressResolver resolver,
             OutputStream os)
             throws IOException
Writes the document to the given OutputStream.

Since ServiceDefinition doesn't know which endpoint address Adapter is serving to, (and often it serves multiple URLs simultaneously), this method takes the PortAddressResolver as a parameter, so that it can produce the corret address information in the generated WSDL.

Parameters:
portAddressResolver - An endpoint address resolver that gives endpoint address for a WSDL port. Can be null.
resolver - Used to resolve relative references among documents.
os - The OutputStream that receives the generated document.
Throws:
IOException - if there was a failure reported from the OutputStream.

writeTo

void writeTo(PortAddressResolver portAddressResolver,
             DocumentAddressResolver resolver,
             javax.xml.stream.XMLStreamWriter out)
             throws javax.xml.stream.XMLStreamException,
                    IOException
Writes the document to the given XMLStreamWriter.

The same as writeTo(PortAddressResolver,DocumentAddressResolver,OutputStream) except it writes to an XMLStreamWriter.

The implementation must not call XMLStreamWriter.writeStartDocument() nor XMLStreamWriter.writeEndDocument(). Those are the caller's responsibility.

Throws:
javax.xml.stream.XMLStreamException - if the XMLStreamWriter reports an error.
IOException