java.lang.Object
com.sun.xml.messaging.saaj.util.stax.SaajStaxWriter
- All Implemented Interfaces:
XMLStreamWriter
- Direct Known Subclasses:
SaajStaxWriterEx
SaajStaxWriter builds a SAAJ SOAPMessage by using XMLStreamWriter interface.
Defers creation of SOAPElement until all the aspects of the name of the element are known.
In some cases, the namespace uri is indicated only by the writeNamespace(String, String)
call.
After opening an element (writeStartElement
, writeEmptyElement
methods), all attributes
and namespace assignments are retained within SaajStaxWriter.DeferredElement
object (deferredElement
field).
As soon as any other method than writeAttribute
, writeNamespace
, writeDefaultNamespace
or setNamespace
is called, the contents of deferredElement
is transformed into new SOAPElement
(which is appropriately inserted into the SOAPMessage under construction).
This mechanism is necessary to fix JDK-8159058 issue.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Holds details of element that needs to be deferred in order to manage namespace assignments correctly. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected SOAPElement
protected SaajStaxWriter.DeferredElement
protected static final String
protected String
protected static final String
protected SOAPMessage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
flush()
protected SOAPElement
getProperty
(String name) void
void
setNamespaceContext
(NamespaceContext context) void
void
writeAttribute
(String ln, String val) void
writeAttribute
(String ns, String ln, String val) void
writeAttribute
(String prefix, String ns, String ln, String value) void
writeCData
(String data) void
writeCharacters
(char[] text, int start, int len) void
writeCharacters
(String text) void
writeComment
(String data) void
void
void
void
writeEmptyElement
(String uri, String ln) void
writeEmptyElement
(String prefix, String ln, String uri) void
void
void
writeEntityRef
(String name) void
writeNamespace
(String prefix, String uri) void
writeProcessingInstruction
(String target) void
writeProcessingInstruction
(String target, String data) void
void
writeStartDocument
(String version) void
writeStartDocument
(String encoding, String version) void
writeStartElement
(String localName) void
writeStartElement
(String ns, String ln) void
writeStartElement
(String prefix, String ln, String ns)
-
Field Details
-
soap
-
envURI
-
currentElement
-
deferredElement
-
Envelope
- See Also:
-
Header
- See Also:
-
Body
- See Also:
-
-
Constructor Details
-
SaajStaxWriter
- Throws:
SOAPException
-
-
Method Details
-
getSOAPMessage
-
getEnvelope
- Throws:
SOAPException
-
writeStartElement
- Specified by:
writeStartElement
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeStartElement
- Specified by:
writeStartElement
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeStartElement
- Specified by:
writeStartElement
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeEmptyElement
- Specified by:
writeEmptyElement
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeEmptyElement
- Specified by:
writeEmptyElement
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeEmptyElement
- Specified by:
writeEmptyElement
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeEndElement
- Specified by:
writeEndElement
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeEndDocument
- Specified by:
writeEndDocument
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
close
- Specified by:
close
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
flush
- Specified by:
flush
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeAttribute
- Specified by:
writeAttribute
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeAttribute
public void writeAttribute(String prefix, String ns, String ln, String value) throws XMLStreamException - Specified by:
writeAttribute
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeAttribute
- Specified by:
writeAttribute
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeNamespace
- Specified by:
writeNamespace
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeDefaultNamespace
- Specified by:
writeDefaultNamespace
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeComment
- Specified by:
writeComment
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeProcessingInstruction
- Specified by:
writeProcessingInstruction
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeProcessingInstruction
- Specified by:
writeProcessingInstruction
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeCData
- Specified by:
writeCData
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeDTD
- Specified by:
writeDTD
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeEntityRef
- Specified by:
writeEntityRef
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeStartDocument
- Specified by:
writeStartDocument
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeStartDocument
- Specified by:
writeStartDocument
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeStartDocument
- Specified by:
writeStartDocument
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeCharacters
- Specified by:
writeCharacters
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
writeCharacters
- Specified by:
writeCharacters
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
getPrefix
- Specified by:
getPrefix
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
setPrefix
- Specified by:
setPrefix
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
setDefaultNamespace
- Specified by:
setDefaultNamespace
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
setNamespaceContext
- Specified by:
setNamespaceContext
in interfaceXMLStreamWriter
- Throws:
XMLStreamException
-
getProperty
- Specified by:
getProperty
in interfaceXMLStreamWriter
- Throws:
IllegalArgumentException
-
getNamespaceContext
- Specified by:
getNamespaceContext
in interfaceXMLStreamWriter
-