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
SDDocumentimplmentation.This extends from
SDDocumentSourceso that JAX-WS server runtime code can useSDDocumentasSDDocumentSource.- 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 protectedSDDocumentImpl(QName rootName, URL url, SDDocumentSource source)protectedSDDocumentImpl(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 SDDocumentImplcreate(SDDocumentSource src, QName serviceName, QName portTypeName)CreatesSDDocumentfromSDDocumentSource.Set<String>getImports()returns the referenced documentsQNamegetRootName()Gets the root tag name of this document.URLgetSystemId()System ID of this document.URLgetURL()Gets the system ID of the document where it's taken from.booleanisSchema()Returns true if this document is schema.booleanisWSDL()Returns true if this document is WSDL.XMLStreamReaderread()Returns theXMLStreamReaderthat reads the document.XMLStreamReaderread(XMLInputFactory xif)Returns theXMLStreamReaderthat reads the document.voidwriteTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, OutputStream os)Writes the document to the givenOutputStream.voidwriteTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, XMLStreamWriter out)Writes the document to the givenXMLStreamWriter.voidwriteTo(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)
CreatesSDDocumentfromSDDocumentSource.- Parameters:
src- WSDL document infosetserviceName- wsdl:service nameportTypeName- The information about the port ofWSEndpointto 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:SDDocumentGets the root tag name of this document.This can be used to identify a kind of document quickly (such as schema, WSDL, ...)
- Specified by:
getRootNamein interfaceSDDocument- Returns:
- always non-null.
-
isWSDL
public boolean isWSDL()
Description copied from interface:SDDocumentReturns true if this document is WSDL.- Specified by:
isWSDLin interfaceSDDocument
-
isSchema
public boolean isSchema()
Description copied from interface:SDDocumentReturns true if this document is schema.- Specified by:
isSchemain interfaceSDDocument
-
getURL
public URL getURL()
Description copied from interface:SDDocumentGets 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:
getURLin interfaceSDDocument
-
read
public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException
Description copied from class:SDDocumentSourceReturns theXMLStreamReaderthat reads the document.This method maybe invoked multiple times concurrently.
- Specified by:
readin 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:SDDocumentSourceReturns theXMLStreamReaderthat reads the document.This method maybe invoked multiple times concurrently.
- Specified by:
readin 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:SDDocumentSourceSystem ID of this document.- Specified by:
getSystemIdin classSDDocumentSource- Returns:
-
getImports
public Set<String> getImports()
Description copied from interface:SDDocumentreturns the referenced documents- Specified by:
getImportsin 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:SDDocumentWrites the document to the givenOutputStream.Since
ServiceDefinitiondoesn't know which endpoint addressAdapteris 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:
writeToin 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- TheOutputStreamthat 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:SDDocumentWrites 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:
writeToin interfaceSDDocument- Throws:
XMLStreamException- if theXMLStreamWriterreports an error.IOException
-
-