Package com.sun.xml.stream.buffer.stax
Class StreamWriterBufferCreator
- java.lang.Object
-
- com.sun.xml.stream.buffer.AbstractCreatorProcessor
-
- com.sun.xml.stream.buffer.AbstractCreator
-
- com.sun.xml.stream.buffer.stax.StreamWriterBufferCreator
-
- All Implemented Interfaces:
XMLStreamWriter,org.jvnet.staxex.XMLStreamWriterEx
public class StreamWriterBufferCreator extends AbstractCreator implements org.jvnet.staxex.XMLStreamWriterEx
XMLStreamWriterthat fillsMutableXMLStreamBuffer.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
Fields Modifier and Type Field Description protected List<String>attributeValuePrefixes-
Fields inherited from class com.sun.xml.stream.buffer.AbstractCreator
_buffer
-
Fields inherited from class com.sun.xml.stream.buffer.AbstractCreatorProcessor
_contentCharactersBuffer, _contentCharactersBufferPtr, _contentObjects, _contentObjectsPtr, _currentContentCharactersBufferFragment, _currentContentObjectFragment, _currentStructureFragment, _currentStructureStringFragment, _structure, _structurePtr, _structureStrings, _structureStringsPtr, CHAR_ARRAY_LENGTH_MEDIUM, CHAR_ARRAY_LENGTH_MEDIUM_SIZE, CHAR_ARRAY_LENGTH_SMALL, CHAR_ARRAY_LENGTH_SMALL_SIZE, CONTENT_TYPE_CHAR_ARRAY, CONTENT_TYPE_CHAR_ARRAY_COPY, CONTENT_TYPE_OBJECT, CONTENT_TYPE_STRING, FLAG_DOCUMENT_FRAGMENT, FLAG_PREFIX, FLAG_QUALIFIED_NAME, FLAG_URI, T_ATTRIBUTE, T_ATTRIBUTE_LN, T_ATTRIBUTE_LN_OBJECT, T_ATTRIBUTE_P_U_LN, T_ATTRIBUTE_P_U_LN_OBJECT, T_ATTRIBUTE_U_LN, T_ATTRIBUTE_U_LN_OBJECT, T_ATTRIBUTE_U_LN_QN, T_ATTRIBUTE_U_LN_QN_OBJECT, T_COMMENT, T_COMMENT_AS_CHAR_ARRAY, T_COMMENT_AS_CHAR_ARRAY_COPY, T_COMMENT_AS_CHAR_ARRAY_MEDIUM, T_COMMENT_AS_CHAR_ARRAY_SMALL, T_COMMENT_AS_STRING, T_DOCUMENT, T_DOCUMENT_FRAGMENT, T_ELEMENT, T_ELEMENT_LN, T_ELEMENT_P_U_LN, T_ELEMENT_U_LN, T_ELEMENT_U_LN_QN, T_END, T_END_OF_BUFFER, T_NAMESPACE_ATTRIBUTE, T_NAMESPACE_ATTRIBUTE_P, T_NAMESPACE_ATTRIBUTE_P_U, T_NAMESPACE_ATTRIBUTE_U, T_PROCESSING_INSTRUCTION, T_TEXT, T_TEXT_AS_CHAR_ARRAY, T_TEXT_AS_CHAR_ARRAY_COPY, T_TEXT_AS_CHAR_ARRAY_MEDIUM, T_TEXT_AS_CHAR_ARRAY_SMALL, T_TEXT_AS_OBJECT, T_TEXT_AS_STRING, T_UNEXPANDED_ENTITY_REFERENCE, TYPE_MASK, VALUE_TYPE_OBJECT, VALUE_TYPE_STRING
-
-
Constructor Summary
Constructors Constructor Description StreamWriterBufferCreator()StreamWriterBufferCreator(MutableXMLStreamBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()ListgetAttributeValuePrefixes()org.jvnet.staxex.NamespaceContextExgetNamespaceContext()StringgetPrefix(String namespaceURI)ObjectgetProperty(String str)booleanisCheckAttributeValue()voidsetCheckAttributeValue(boolean value)voidsetDefaultNamespace(String namespaceURI)voidsetNamespaceContext(NamespaceContext namespaceContext)voidsetPrefix(String prefix, String namespaceURI)protected voidstoreAttribute(String prefix, String uri, String localName, String type, String value)protected voidstoreNamespaceAttribute(String prefix, String uri)protected voidstoreProcessingInstruction(String target, String data)protected voidstoreQualifiedName(int item, String prefix, String uri, String localName)voidwriteAttribute(String localName, String value)voidwriteAttribute(String namespaceURI, String localName, String value)voidwriteAttribute(String prefix, String namespaceURI, String localName, String value)voidwriteBinary(byte[] bytes, int offset, int length, String endpointURL)voidwriteBinary(jakarta.activation.DataHandler dataHandler)OutputStreamwriteBinary(String endpointURL)voidwriteCData(String data)voidwriteCharacters(char[] buf, int start, int len)voidwriteCharacters(String charData)voidwriteComment(String str)voidwriteDefaultNamespace(String namespaceURI)voidwriteDTD(String str)voidwriteEmptyElement(String localName)voidwriteEmptyElement(String namespaceURI, String localName)voidwriteEmptyElement(String prefix, String localName, String namespaceURI)voidwriteEndDocument()voidwriteEndElement()voidwriteEntityRef(String str)voidwriteNamespace(String prefix, String namespaceURI)voidwritePCDATA(CharSequence charSequence)voidwriteProcessingInstruction(String target)voidwriteProcessingInstruction(String target, String data)voidwriteStartDocument()voidwriteStartDocument(String version)voidwriteStartDocument(String encoding, String version)voidwriteStartElement(String localName)voidwriteStartElement(String namespaceURI, String localName)voidwriteStartElement(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
-
-
-
-
Constructor Detail
-
StreamWriterBufferCreator
public StreamWriterBufferCreator()
-
StreamWriterBufferCreator
public StreamWriterBufferCreator(MutableXMLStreamBuffer buffer)
-
-
Method Detail
-
getProperty
public Object getProperty(String str) throws IllegalArgumentException
- Specified by:
getPropertyin interfaceXMLStreamWriter- Throws:
IllegalArgumentException
-
close
public void close() throws XMLStreamException- Specified by:
closein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
flush
public void flush() throws XMLStreamException- Specified by:
flushin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
getNamespaceContext
public org.jvnet.staxex.NamespaceContextEx getNamespaceContext()
- Specified by:
getNamespaceContextin interfaceXMLStreamWriter- Specified by:
getNamespaceContextin interfaceorg.jvnet.staxex.XMLStreamWriterEx
-
setNamespaceContext
public void setNamespaceContext(NamespaceContext namespaceContext) throws XMLStreamException
- Specified by:
setNamespaceContextin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
setDefaultNamespace
public void setDefaultNamespace(String namespaceURI) throws XMLStreamException
- Specified by:
setDefaultNamespacein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
setPrefix
public void setPrefix(String prefix, String namespaceURI) throws XMLStreamException
- Specified by:
setPrefixin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
getPrefix
public String getPrefix(String namespaceURI) throws XMLStreamException
- Specified by:
getPrefixin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartDocument
public void writeStartDocument() throws XMLStreamException- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartDocument
public void writeStartDocument(String version) throws XMLStreamException
- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartDocument
public void writeStartDocument(String encoding, String version) throws XMLStreamException
- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEndDocument
public void writeEndDocument() throws XMLStreamException- Specified by:
writeEndDocumentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartElement
public void writeStartElement(String localName) throws XMLStreamException
- Specified by:
writeStartElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartElement
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException
- Specified by:
writeStartElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeStartElement
public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
- Specified by:
writeStartElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEmptyElement
public void writeEmptyElement(String localName) throws XMLStreamException
- Specified by:
writeEmptyElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEmptyElement
public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException
- Specified by:
writeEmptyElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEmptyElement
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
- Specified by:
writeEmptyElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEndElement
public void writeEndElement() throws XMLStreamException- Specified by:
writeEndElementin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeDefaultNamespace
public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException
- Specified by:
writeDefaultNamespacein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeNamespace
public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException
- Specified by:
writeNamespacein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeAttribute
public void writeAttribute(String localName, String value) throws XMLStreamException
- Specified by:
writeAttributein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeAttribute
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException
- Specified by:
writeAttributein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeAttribute
public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException
- Specified by:
writeAttributein interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeCData
public void writeCData(String data) throws XMLStreamException
- Specified by:
writeCDatain interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeCharacters
public void writeCharacters(String charData) throws XMLStreamException
- Specified by:
writeCharactersin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeCharacters
public void writeCharacters(char[] buf, int start, int len) throws XMLStreamException- Specified by:
writeCharactersin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeComment
public void writeComment(String str) throws XMLStreamException
- Specified by:
writeCommentin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeDTD
public void writeDTD(String str) throws XMLStreamException
- Specified by:
writeDTDin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeEntityRef
public void writeEntityRef(String str) throws XMLStreamException
- Specified by:
writeEntityRefin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeProcessingInstruction
public void writeProcessingInstruction(String target) throws XMLStreamException
- Specified by:
writeProcessingInstructionin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writeProcessingInstruction
public void writeProcessingInstruction(String target, String data) throws XMLStreamException
- Specified by:
writeProcessingInstructionin interfaceXMLStreamWriter- Throws:
XMLStreamException
-
writePCDATA
public void writePCDATA(CharSequence charSequence) throws XMLStreamException
- Specified by:
writePCDATAin interfaceorg.jvnet.staxex.XMLStreamWriterEx- Throws:
XMLStreamException
-
writeBinary
public void writeBinary(byte[] bytes, int offset, int length, String endpointURL) throws XMLStreamException- Specified by:
writeBinaryin interfaceorg.jvnet.staxex.XMLStreamWriterEx- Throws:
XMLStreamException
-
writeBinary
public void writeBinary(jakarta.activation.DataHandler dataHandler) throws XMLStreamException- Specified by:
writeBinaryin interfaceorg.jvnet.staxex.XMLStreamWriterEx- Throws:
XMLStreamException
-
writeBinary
public OutputStream writeBinary(String endpointURL) throws XMLStreamException
- Specified by:
writeBinaryin interfaceorg.jvnet.staxex.XMLStreamWriterEx- Throws:
XMLStreamException
-
storeQualifiedName
protected void storeQualifiedName(int item, String prefix, String uri, String localName)
-
storeAttribute
protected final void storeAttribute(String prefix, String uri, String localName, String type, String value)
-
getAttributeValuePrefixes
public final List getAttributeValuePrefixes()
-
storeProcessingInstruction
protected final void storeProcessingInstruction(String target, String data)
-
isCheckAttributeValue
public final boolean isCheckAttributeValue()
-
setCheckAttributeValue
public final void setCheckAttributeValue(boolean value)
-
-