Class SDDocumentImpl
- java.lang.Object
-
- com.sun.xml.ws.api.server.SDDocumentSource
-
- com.sun.xml.ws.server.SDDocumentImpl
-
- All Implemented Interfaces:
SDDocument
public class SDDocumentImpl extends SDDocumentSource implements SDDocument
SDDocument
implmentation.This extends from
SDDocumentSource
so that JAX-WS server runtime code can useSDDocument
asSDDocumentSource
.- Author:
- Kohsuke Kawaguchi, Jitendra Kotamraju
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.sun.xml.ws.api.server.SDDocument
SDDocument.Schema, SDDocument.WSDL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SDDocumentImpl(QName rootName, URL url, SDDocumentSource source)
protected
SDDocumentImpl(QName rootName, URL url, SDDocumentSource source, Set<String> imports)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SDDocumentImpl
create(SDDocumentSource src, QName serviceName, QName portTypeName)
CreatesSDDocument
fromSDDocumentSource
.Set<String>
getImports()
returns the referenced documentsQName
getRootName()
Gets the root tag name of this document.URL
getSystemId()
System ID 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.XMLStreamReader
read()
Returns theXMLStreamReader
that reads the document.XMLStreamReader
read(XMLInputFactory xif)
Returns theXMLStreamReader
that reads the document.void
writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, OutputStream os)
Writes the document to the givenOutputStream
.void
writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, XMLStreamWriter out)
Writes the document to the givenXMLStreamWriter
.void
writeTo(OutputStream os)
-
Methods inherited from class com.sun.xml.ws.api.server.SDDocumentSource
create, create, create
-
-
-
-
Constructor Detail
-
SDDocumentImpl
protected SDDocumentImpl(QName rootName, URL url, SDDocumentSource source)
-
SDDocumentImpl
protected SDDocumentImpl(QName rootName, URL url, SDDocumentSource source, Set<String> imports)
-
-
Method Detail
-
create
public static SDDocumentImpl create(SDDocumentSource src, QName serviceName, QName portTypeName)
CreatesSDDocument
fromSDDocumentSource
.- Parameters:
src
- WSDL document infosetserviceName
- wsdl:service nameportTypeName
- The information about the port ofWSEndpoint
to which this document is built for. These values are used to determine which document is the concrete and abstract WSDLs for this endpoint.- Returns:
- null Always non-null.
-
getRootName
public QName getRootName()
Description copied from interface:SDDocument
Gets the root tag name of this document.This can be used to identify a kind of document quickly (such as schema, WSDL, ...)
- Specified by:
getRootName
in interfaceSDDocument
- Returns:
- always non-null.
-
isWSDL
public boolean isWSDL()
Description copied from interface:SDDocument
Returns true if this document is WSDL.- Specified by:
isWSDL
in interfaceSDDocument
-
isSchema
public boolean isSchema()
Description copied from interface:SDDocument
Returns true if this document is schema.- Specified by:
isSchema
in interfaceSDDocument
-
getURL
public URL getURL()
Description copied from interface:SDDocument
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.- Specified by:
getURL
in interfaceSDDocument
-
read
public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException
Description copied from class:SDDocumentSource
Returns theXMLStreamReader
that reads the document.This method maybe invoked multiple times concurrently.
- Specified by:
read
in classSDDocumentSource
- Parameters:
xif
- The implementation may choose to use this object when it wants to create a new parser (or it can just ignore this parameter completely.)- Returns:
- The caller is responsible for closing the reader to avoid resource leak.
- Throws:
IOException
- if something goes wrong trying to read the document.XMLStreamException
- if something goes wrong while creating a parser.
-
read
public XMLStreamReader read() throws IOException, XMLStreamException
Description copied from class:SDDocumentSource
Returns theXMLStreamReader
that reads the document.This method maybe invoked multiple times concurrently.
- Specified by:
read
in classSDDocumentSource
- Returns:
- The caller is responsible for closing the reader to avoid resource leak.
- Throws:
IOException
- if something goes wrong trying to read the document.XMLStreamException
- if something goes wrong while creating a parser.
-
getSystemId
public URL getSystemId()
Description copied from class:SDDocumentSource
System ID of this document.- Specified by:
getSystemId
in classSDDocumentSource
- Returns:
-
getImports
public Set<String> getImports()
Description copied from interface:SDDocument
returns the referenced documents- Specified by:
getImports
in interfaceSDDocument
-
writeTo
public void writeTo(OutputStream os) throws IOException
- Throws:
IOException
-
writeTo
public void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, OutputStream os) throws IOException
Description copied from interface:SDDocument
Writes the document to the givenOutputStream
.Since
ServiceDefinition
doesn't know which endpoint addressAdapter
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.- Specified by:
writeTo
in interfaceSDDocument
- 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
- TheOutputStream
that receives the generated document.- Throws:
IOException
- if there was a failure reported from theOutputStream
.
-
writeTo
public void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, XMLStreamWriter out) throws XMLStreamException, IOException
Description copied from interface:SDDocument
Writes the document to the givenXMLStreamWriter
.The same as
SDDocument.writeTo(PortAddressResolver,DocumentAddressResolver,OutputStream)
except it writes to anXMLStreamWriter
.The implementation must not call
XMLStreamWriter.writeStartDocument()
norXMLStreamWriter.writeEndDocument()
. Those are the caller's responsibility.- Specified by:
writeTo
in interfaceSDDocument
- Throws:
XMLStreamException
- if theXMLStreamWriter
reports an error.IOException
-
-