|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvnet.staxex.util.SaajStaxWriter
org.jvnet.staxex.util.SaajStaxWriterEx
public class SaajStaxWriterEx
SaajStaxWriterEx converts XMLStreamWriterEx calls to build an orasaaj SOAPMessage with BinaryTextImpl.
| Field Summary | |
|---|---|
protected static java.lang.String |
href
|
protected static java.lang.String |
Include
|
protected static java.lang.String |
xopNS
|
| Fields inherited from class org.jvnet.staxex.util.SaajStaxWriter |
|---|
Body, currentElement, Envelope, envURI, Header, soap, xmlns |
| Constructor Summary | |
|---|---|
SaajStaxWriterEx(javax.xml.soap.SOAPMessage msg,
java.lang.String uri)
|
|
| Method Summary | |
|---|---|
javax.xml.bind.attachment.AttachmentMarshaller |
getAttachmentMarshaller()
|
NamespaceContextEx |
getNamespaceContext()
|
void |
writeAttribute(java.lang.String prefix,
java.lang.String ns,
java.lang.String ln,
java.lang.String value)
|
void |
writeBinary(byte[] data,
int offset,
int length,
java.lang.String contentType)
Write the binary data. |
void |
writeBinary(javax.activation.DataHandler data)
Writes the binary data. |
java.io.OutputStream |
writeBinary(java.lang.String arg0)
Writes the binary data. |
void |
writeEndElement()
|
void |
writePCDATA(java.lang.CharSequence arg0)
Writes like XMLStreamWriter.writeCharacters(String) but hides
actual data format. |
void |
writeStartElement(java.lang.String prefix,
java.lang.String ln,
java.lang.String ns)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.xml.stream.XMLStreamWriter |
|---|
close, flush, getPrefix, getProperty, setDefaultNamespace, setNamespaceContext, setPrefix, writeAttribute, writeAttribute, writeCData, writeCharacters, writeCharacters, writeComment, writeDefaultNamespace, writeDTD, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndDocument, writeEntityRef, writeNamespace, writeProcessingInstruction, writeProcessingInstruction, writeStartDocument, writeStartDocument, writeStartDocument, writeStartElement, writeStartElement |
| Field Detail |
|---|
protected static final java.lang.String xopNS
protected static final java.lang.String Include
protected static final java.lang.String href
| Constructor Detail |
|---|
public SaajStaxWriterEx(javax.xml.soap.SOAPMessage msg,
java.lang.String uri)
throws javax.xml.soap.SOAPException
javax.xml.soap.SOAPException| Method Detail |
|---|
public void writeStartElement(java.lang.String prefix,
java.lang.String ln,
java.lang.String ns)
throws javax.xml.stream.XMLStreamException
writeStartElement in interface javax.xml.stream.XMLStreamWriterwriteStartElement in class SaajStaxWriterjavax.xml.stream.XMLStreamException
public void writeEndElement()
throws javax.xml.stream.XMLStreamException
writeEndElement in interface javax.xml.stream.XMLStreamWriterwriteEndElement in class SaajStaxWriterjavax.xml.stream.XMLStreamException
public void writeAttribute(java.lang.String prefix,
java.lang.String ns,
java.lang.String ln,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
writeAttribute in interface javax.xml.stream.XMLStreamWriterwriteAttribute in class SaajStaxWriterjavax.xml.stream.XMLStreamExceptionpublic NamespaceContextEx getNamespaceContext()
XMLStreamWriterEx
getNamespaceContext in interface javax.xml.stream.XMLStreamWritergetNamespaceContext in interface XMLStreamWriterExgetNamespaceContext in class SaajStaxWriter
public void writeBinary(javax.activation.DataHandler data)
throws javax.xml.stream.XMLStreamException
XMLStreamWriterEx
This method works like the XMLStreamWriterEx.writeBinary(byte[], int, int, String) method,
except that it takes the binary data in the form of DataHandler, which
contains a MIME type (DataHandler.getContentType() as well as the payload
DataHandler.getInputStream().
writeBinary in interface XMLStreamWriterExdata - always non-null. After this method call, the callee owns the data handler.
javax.xml.stream.XMLStreamException
public java.io.OutputStream writeBinary(java.lang.String arg0)
throws javax.xml.stream.XMLStreamException
XMLStreamWriterEx
This version of the writeBinary method allows the caller to produce
the binary data by writing it to OutputStream.
It is the caller's responsibility to write and close
a stream before it invokes any other methods on XMLStreamWriter.
TODO: experimental. appreciate feedback
writeBinary in interface XMLStreamWriterExarg0 - See the content-type parameter of
XMLStreamWriterEx.writeBinary(byte[], int, int, String). Must not be null.
OutputStream.
javax.xml.stream.XMLStreamException
public void writeBinary(byte[] data,
int offset,
int length,
java.lang.String contentType)
throws javax.xml.stream.XMLStreamException
XMLStreamWriterExConceptually (infoset-wise), this produces the base64-encoded binary data on the output. But this allows implementations like FastInfoset or XOP to do the smart thing.
The use of this method has some restriction to support XOP. Namely, this method must be invoked as a sole content of an element.
(data,start,len) triplet identifies the binary data to be written. After the method invocation, the callee owns the buffer.
writeBinary in interface XMLStreamWriterExcontentType - this mandatory parameter identifies the MIME type of the binary data.
If the MIME type isn't known by the caller, "application/octet-stream" can
be always used to indicate "I don't know." Never null.
javax.xml.stream.XMLStreamException
public void writePCDATA(java.lang.CharSequence arg0)
throws javax.xml.stream.XMLStreamException
XMLStreamWriterExXMLStreamWriter.writeCharacters(String) but hides
actual data format.
writePCDATA in interface XMLStreamWriterExarg0 - The CharSequence that represents the
character infoset items to be written.
The CharSequence is normally a String,
but can be any other CharSequence implementation.
For binary data, however, use of Base64Data is
recommended (so that the consumer interested in seeing it
as binary data may take advantage of mor efficient
data representation.)
javax.xml.stream.XMLStreamExceptionpublic javax.xml.bind.attachment.AttachmentMarshaller getAttachmentMarshaller()
getAttachmentMarshaller in interface MtomStreamWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||