Class SDDocumentImpl
- All Implemented Interfaces:
SDDocument
SDDocument implmentation.
This extends from SDDocumentSource so that
JAX-WS server runtime code can use SDDocument
as SDDocumentSource.
- 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
ConstructorsModifierConstructorDescriptionprotectedSDDocumentImpl(QName rootName, URL url, SDDocumentSource source) protectedSDDocumentImpl(QName rootName, URL url, SDDocumentSource source, Set<String> imports) -
Method Summary
Modifier and TypeMethodDescriptionstatic SDDocumentImplcreate(SDDocumentSource src, QName serviceName, QName portTypeName) CreatesSDDocumentfromSDDocumentSource.returns the referenced documentsGets the root tag name of this document.System ID of this document.getURL()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.read()Returns theXMLStreamReaderthat reads the document.read(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 Details
-
SDDocumentImpl
-
SDDocumentImpl
-
-
Method Details
-
create
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
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
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
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
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
Description copied from class:SDDocumentSourceSystem ID of this document.- Specified by:
getSystemIdin classSDDocumentSource
-
getImports
Description copied from interface:SDDocumentreturns the referenced documents- Specified by:
getImportsin interfaceSDDocument
-
writeTo
- 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
-