- All Known Subinterfaces:
SDDocument.Schema
,SDDocument.WSDL
- All Known Implementing Classes:
SDDocumentImpl
@ManagedData
public interface SDDocument
Represents an individual document that forms a
ServiceDefinition
.
TODO: how does those documents refer to each other?
- Author:
- Jitendra Kotamraju
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
SDDocument
that represents an XML Schema.static interface
SDDocument
that represents a WSDL. -
Method Summary
Modifier and TypeMethodDescriptionreturns the referenced documentsGets the root tag name of this document.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 givenOutputStream
.void
writeTo
(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, XMLStreamWriter out) Writes the document to the givenXMLStreamWriter
.
-
Method Details
-
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
@ManagedAttribute boolean isWSDL()Returns true if this document is WSDL. -
isSchema
@ManagedAttribute boolean isSchema()Returns true if this document is schema. -
getImports
returns the referenced documents -
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 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.- 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
void writeTo(PortAddressResolver portAddressResolver, DocumentAddressResolver resolver, XMLStreamWriter out) throws XMLStreamException, IOException Writes the document to the givenXMLStreamWriter
.The same as
writeTo(PortAddressResolver,DocumentAddressResolver,OutputStream)
except it writes to anXMLStreamWriter
.The implementation must not call
XMLStreamWriter.writeStartDocument()
norXMLStreamWriter.writeEndDocument()
. Those are the caller's responsibility.- Throws:
XMLStreamException
- if theXMLStreamWriter
reports an error.IOException
-