public class SaajStaxWriter extends Object implements XMLStreamWriter
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 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.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
Body |
protected SOAPElement |
currentElement |
protected com.sun.xml.messaging.saaj.util.stax.SaajStaxWriter.DeferredElement |
deferredElement |
protected static String |
Envelope |
protected String |
envURI |
protected static String |
Header |
protected SOAPMessage |
soap |
protected static String |
xmlns |
| Constructor and Description |
|---|
SaajStaxWriter(SOAPMessage msg,
String uri) |
protected SOAPMessage soap
protected String envURI
protected SOAPElement currentElement
protected com.sun.xml.messaging.saaj.util.stax.SaajStaxWriter.DeferredElement deferredElement
protected static final String Envelope
protected static final String Header
protected static final String Body
protected static final String xmlns
public SaajStaxWriter(SOAPMessage msg, String uri) throws SOAPException
SOAPExceptionpublic SOAPMessage getSOAPMessage()
protected SOAPElement getEnvelope() throws SOAPException
SOAPExceptionpublic void writeStartElement(String localName) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String ns, String ln) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String prefix, String ln, String ns) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String uri, String ln) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String prefix, String ln, String uri) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String ln) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEndElement()
throws XMLStreamException
writeEndElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEndDocument()
throws XMLStreamException
writeEndDocument in interface XMLStreamWriterXMLStreamExceptionpublic void close()
throws XMLStreamException
close in interface XMLStreamWriterXMLStreamExceptionpublic void flush()
throws XMLStreamException
flush in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String ln, String val) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String prefix, String ns, String ln, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String ns, String ln, String val) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeNamespace(String prefix, String uri) throws XMLStreamException
writeNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void writeDefaultNamespace(String uri) throws XMLStreamException
writeDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void writeComment(String data) throws XMLStreamException
writeComment in interface XMLStreamWriterXMLStreamExceptionpublic void writeProcessingInstruction(String target) throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamExceptionpublic void writeProcessingInstruction(String target, String data) throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamExceptionpublic void writeCData(String data) throws XMLStreamException
writeCData in interface XMLStreamWriterXMLStreamExceptionpublic void writeDTD(String dtd) throws XMLStreamException
writeDTD in interface XMLStreamWriterXMLStreamExceptionpublic void writeEntityRef(String name) throws XMLStreamException
writeEntityRef in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument()
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument(String version) throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument(String encoding, String version) throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeCharacters(String text) throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic void writeCharacters(char[] text,
int start,
int len)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic String getPrefix(String uri) throws XMLStreamException
getPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void setDefaultNamespace(String uri) throws XMLStreamException
setDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void setNamespaceContext(NamespaceContext context) throws XMLStreamException
setNamespaceContext in interface XMLStreamWriterXMLStreamExceptionpublic Object getProperty(String name) throws IllegalArgumentException
getProperty in interface XMLStreamWriterIllegalArgumentExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamWriterCopyright © 2005–2017 Oracle Corporation. All rights reserved.