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
SOAPException
public SOAPMessage getSOAPMessage()
protected SOAPElement getEnvelope() throws SOAPException
SOAPException
public void writeStartElement(String localName) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeStartElement(String ns, String ln) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeStartElement(String prefix, String ln, String ns) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String uri, String ln) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String prefix, String ln, String uri) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String ln) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEndElement() throws XMLStreamException
writeEndElement
in interface XMLStreamWriter
XMLStreamException
public void writeEndDocument() throws XMLStreamException
writeEndDocument
in interface XMLStreamWriter
XMLStreamException
public void close() throws XMLStreamException
close
in interface XMLStreamWriter
XMLStreamException
public void flush() throws XMLStreamException
flush
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String ln, String val) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String prefix, String ns, String ln, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String ns, String ln, String val) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeNamespace(String prefix, String uri) throws XMLStreamException
writeNamespace
in interface XMLStreamWriter
XMLStreamException
public void writeDefaultNamespace(String uri) throws XMLStreamException
writeDefaultNamespace
in interface XMLStreamWriter
XMLStreamException
public void writeComment(String data) throws XMLStreamException
writeComment
in interface XMLStreamWriter
XMLStreamException
public void writeProcessingInstruction(String target) throws XMLStreamException
writeProcessingInstruction
in interface XMLStreamWriter
XMLStreamException
public void writeProcessingInstruction(String target, String data) throws XMLStreamException
writeProcessingInstruction
in interface XMLStreamWriter
XMLStreamException
public void writeCData(String data) throws XMLStreamException
writeCData
in interface XMLStreamWriter
XMLStreamException
public void writeDTD(String dtd) throws XMLStreamException
writeDTD
in interface XMLStreamWriter
XMLStreamException
public void writeEntityRef(String name) throws XMLStreamException
writeEntityRef
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument() throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument(String version) throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument(String encoding, String version) throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeCharacters(String text) throws XMLStreamException
writeCharacters
in interface XMLStreamWriter
XMLStreamException
public void writeCharacters(char[] text, int start, int len) throws XMLStreamException
writeCharacters
in interface XMLStreamWriter
XMLStreamException
public String getPrefix(String uri) throws XMLStreamException
getPrefix
in interface XMLStreamWriter
XMLStreamException
public void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix
in interface XMLStreamWriter
XMLStreamException
public void setDefaultNamespace(String uri) throws XMLStreamException
setDefaultNamespace
in interface XMLStreamWriter
XMLStreamException
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException
setNamespaceContext
in interface XMLStreamWriter
XMLStreamException
public Object getProperty(String name) throws IllegalArgumentException
getProperty
in interface XMLStreamWriter
IllegalArgumentException
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLStreamWriter
Copyright © 2019 JBoss by Red Hat. All rights reserved.