|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.stream.buffer.AbstractCreatorProcessor
com.sun.xml.stream.buffer.AbstractCreator
com.sun.xml.stream.buffer.stax.StreamWriterBufferCreator
public class StreamWriterBufferCreator
XMLStreamWriter that fills MutableXMLStreamBuffer.
TODO: need to retain all attributes/namespaces and then store all namespaces before the attributes. Currently it is necessary for the caller to ensure all namespaces are written before attributes and the caller must not intermix calls to the writeNamespace and writeAttribute methods.
| Field Summary | |
|---|---|
protected List<String> |
attributeValuePrefixes
|
| Fields inherited from class com.sun.xml.stream.buffer.AbstractCreator |
|---|
_buffer |
| Constructor Summary | |
|---|---|
StreamWriterBufferCreator()
|
|
StreamWriterBufferCreator(MutableXMLStreamBuffer buffer)
|
|
| Method Summary | |
|---|---|
void |
close()
|
void |
flush()
|
List |
getAttributeValuePrefixes()
|
NamespaceContextEx |
getNamespaceContext()
|
String |
getPrefix(String namespaceURI)
|
Object |
getProperty(String str)
|
boolean |
isCheckAttributeValue()
|
void |
setCheckAttributeValue(boolean value)
|
void |
setDefaultNamespace(String namespaceURI)
|
void |
setNamespaceContext(NamespaceContext namespaceContext)
|
void |
setPrefix(String prefix,
String namespaceURI)
|
protected void |
storeAttribute(String prefix,
String uri,
String localName,
String type,
String value)
|
protected void |
storeNamespaceAttribute(String prefix,
String uri)
|
protected void |
storeProcessingInstruction(String target,
String data)
|
protected void |
storeQualifiedName(int item,
String prefix,
String uri,
String localName)
|
void |
writeAttribute(String localName,
String value)
|
void |
writeAttribute(String namespaceURI,
String localName,
String value)
|
void |
writeAttribute(String prefix,
String namespaceURI,
String localName,
String value)
|
void |
writeBinary(byte[] bytes,
int offset,
int length,
String endpointURL)
Write the binary data. |
void |
writeBinary(DataHandler dataHandler)
Writes the binary data. |
OutputStream |
writeBinary(String endpointURL)
Writes the binary data. |
void |
writeCData(String data)
|
void |
writeCharacters(char[] buf,
int start,
int len)
|
void |
writeCharacters(String charData)
|
void |
writeComment(String str)
|
void |
writeDefaultNamespace(String namespaceURI)
|
void |
writeDTD(String str)
|
void |
writeEmptyElement(String localName)
|
void |
writeEmptyElement(String namespaceURI,
String localName)
|
void |
writeEmptyElement(String prefix,
String localName,
String namespaceURI)
|
void |
writeEndDocument()
|
void |
writeEndElement()
|
void |
writeEntityRef(String str)
|
void |
writeNamespace(String prefix,
String namespaceURI)
|
void |
writePCDATA(CharSequence charSequence)
Writes like XMLStreamWriter.writeCharacters(String) but hides
actual data format. |
void |
writeProcessingInstruction(String target)
|
void |
writeProcessingInstruction(String target,
String data)
|
void |
writeStartDocument()
|
void |
writeStartDocument(String version)
|
void |
writeStartDocument(String encoding,
String version)
|
void |
writeStartElement(String localName)
|
void |
writeStartElement(String namespaceURI,
String localName)
|
void |
writeStartElement(String prefix,
String localName,
String namespaceURI)
|
| Methods inherited from class com.sun.xml.stream.buffer.AbstractCreator |
|---|
createBuffer, getXMLStreamBuffer, increaseTreeCount, peekAtContentObject, resizeContentCharacters, resizeContentObjects, resizeStructure, resizeStructureStrings, setBuffer, setHasInternedStrings, setXMLStreamBuffer, storeContentCharacters, storeContentCharactersCopy, storeContentObject, storeContentString, storeStructure, storeStructureString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<String> attributeValuePrefixes
| Constructor Detail |
|---|
public StreamWriterBufferCreator()
public StreamWriterBufferCreator(MutableXMLStreamBuffer buffer)
| Method Detail |
|---|
public Object getProperty(String str)
throws IllegalArgumentException
getProperty in interface XMLStreamWriterIllegalArgumentException
public void close()
throws XMLStreamException
close in interface XMLStreamWriterXMLStreamException
public void flush()
throws XMLStreamException
flush in interface XMLStreamWriterXMLStreamExceptionpublic NamespaceContextEx getNamespaceContext()
XMLStreamWriterEx
getNamespaceContext in interface XMLStreamWritergetNamespaceContext in interface XMLStreamWriterEx
public void setNamespaceContext(NamespaceContext namespaceContext)
throws XMLStreamException
setNamespaceContext in interface XMLStreamWriterXMLStreamException
public void setDefaultNamespace(String namespaceURI)
throws XMLStreamException
setDefaultNamespace in interface XMLStreamWriterXMLStreamException
public void setPrefix(String prefix,
String namespaceURI)
throws XMLStreamException
setPrefix in interface XMLStreamWriterXMLStreamException
public String getPrefix(String namespaceURI)
throws XMLStreamException
getPrefix in interface XMLStreamWriterXMLStreamException
public void writeStartDocument()
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamException
public void writeStartDocument(String version)
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamException
public void writeStartDocument(String encoding,
String version)
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamException
public void writeEndDocument()
throws XMLStreamException
writeEndDocument in interface XMLStreamWriterXMLStreamException
public void writeStartElement(String localName)
throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamException
public void writeStartElement(String namespaceURI,
String localName)
throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamException
public void writeStartElement(String prefix,
String localName,
String namespaceURI)
throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamException
public void writeEmptyElement(String localName)
throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamException
public void writeEmptyElement(String namespaceURI,
String localName)
throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamException
public void writeEmptyElement(String prefix,
String localName,
String namespaceURI)
throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamException
public void writeEndElement()
throws XMLStreamException
writeEndElement in interface XMLStreamWriterXMLStreamException
public void writeDefaultNamespace(String namespaceURI)
throws XMLStreamException
writeDefaultNamespace in interface XMLStreamWriterXMLStreamException
public void writeNamespace(String prefix,
String namespaceURI)
throws XMLStreamException
writeNamespace in interface XMLStreamWriterXMLStreamException
public void writeAttribute(String localName,
String value)
throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamException
public void writeAttribute(String namespaceURI,
String localName,
String value)
throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamException
public void writeAttribute(String prefix,
String namespaceURI,
String localName,
String value)
throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamException
public void writeCData(String data)
throws XMLStreamException
writeCData in interface XMLStreamWriterXMLStreamException
public void writeCharacters(String charData)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamException
public void writeCharacters(char[] buf,
int start,
int len)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamException
public void writeComment(String str)
throws XMLStreamException
writeComment in interface XMLStreamWriterXMLStreamException
public void writeDTD(String str)
throws XMLStreamException
writeDTD in interface XMLStreamWriterXMLStreamException
public void writeEntityRef(String str)
throws XMLStreamException
writeEntityRef in interface XMLStreamWriterXMLStreamException
public void writeProcessingInstruction(String target)
throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamException
public void writeProcessingInstruction(String target,
String data)
throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamException
public void writePCDATA(CharSequence charSequence)
throws XMLStreamException
XMLStreamWriterExXMLStreamWriter.writeCharacters(String) but hides
actual data format.
writePCDATA in interface XMLStreamWriterExcharSequence - 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.)
XMLStreamException
public void writeBinary(byte[] bytes,
int offset,
int length,
String endpointURL)
throws 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 XMLStreamWriterExendpointURL - 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.
XMLStreamException
public void writeBinary(DataHandler dataHandler)
throws 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 XMLStreamWriterExdataHandler - always non-null. After this method call, the callee owns the data handler.
XMLStreamException
public OutputStream writeBinary(String endpointURL)
throws 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 XMLStreamWriterExendpointURL - See the content-type parameter of
XMLStreamWriterEx.writeBinary(byte[], int, int, String). Must not be null.
OutputStream.
XMLStreamException
protected void storeQualifiedName(int item,
String prefix,
String uri,
String localName)
protected final void storeNamespaceAttribute(String prefix,
String uri)
protected final void storeAttribute(String prefix,
String uri,
String localName,
String type,
String value)
public final List getAttributeValuePrefixes()
protected final void storeProcessingInstruction(String target,
String data)
public final boolean isCheckAttributeValue()
public final void setCheckAttributeValue(boolean value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||