public abstract class AbstractXMLStreamWriter<T> extends Object implements XMLStreamWriter
| Constructor and Description |
|---|
AbstractXMLStreamWriter(T rootInfo,
boolean repaireNamespaces)
Create writer instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
NamespaceContext |
getNamespaceContext() |
String |
getPrefix(String namespaceURI) |
Object |
getProperty(String name) |
protected XMLStreamWriterScope<T> |
getScope() |
protected boolean |
isStartDocumentWritten() |
void |
setDefaultNamespace(String namespaceURI) |
void |
setNamespaceContext(NamespaceContext context) |
void |
setPrefix(String prefix,
String namespaceURI) |
protected abstract void |
writeAttr(String prefix,
String localName,
String namespaceURI,
String value)
Write attribute.
|
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 |
writeCData(String data) |
void |
writeCharacters(char[] text,
int start,
int length) |
protected void |
writeCharacters(Object data,
int type) |
void |
writeCharacters(String text) |
void |
writeComment(String data) |
protected abstract void |
writeData(Object data,
int type)
Write characters/comment/dtd/entity data.
|
void |
writeDefaultNamespace(String namespaceURI) |
void |
writeDTD(String dtd) |
void |
writeEmptyElement(String localName) |
void |
writeEmptyElement(String namespaceURI,
String localName) |
void |
writeEmptyElement(String prefix,
String localName,
String namespaceURI) |
void |
writeEndDocument() |
void |
writeEndElement() |
protected abstract void |
writeEndElementTag()
Write end element tag.
|
void |
writeEntityRef(String name) |
void |
writeNamespace(String prefix,
String namespaceURI) |
protected abstract void |
writeNsDecl(String prefix,
String namespaceURI)
Write namespace declaration.
|
protected abstract void |
writePI(String target,
String data)
Read processing instruction.
|
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) |
protected abstract T |
writeStartElementTag(String prefix,
String localPart,
String namespaceURI)
Write open start element tag.
|
protected abstract void |
writeStartElementTagEnd()
Write close start element tag.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitflushpublic AbstractXMLStreamWriter(T rootInfo, boolean repaireNamespaces)
rootInfo - root scope informationprotected XMLStreamWriterScope<T> getScope()
protected boolean isStartDocumentWritten()
true if START_DOCUMENT event has been writtenprotected abstract T writeStartElementTag(String prefix, String localPart, String namespaceURI) throws XMLStreamException
getScope().getInfo().prefix - element prefix (may be XMLConstants.DEFAULT_NS_PREFIX)localPart - local namenamespaceURI - namespace URIXMLStreamExceptionprotected abstract void writeStartElementTagEnd()
throws XMLStreamException
XMLStreamExceptionprotected abstract void writeEndElementTag()
throws XMLStreamException
XMLStreamExceptionprotected abstract void writeAttr(String prefix, String localName, String namespaceURI, String value) throws XMLStreamException
prefix - attribute prefix (may be XMLConstants.DEFAULT_NS_PREFIX)localName - local namenamespaceURI - namespace URIvalue - attribute valueXMLStreamExceptionprotected abstract void writeNsDecl(String prefix, String namespaceURI) throws XMLStreamException
prefix - namespace prefixnamespaceURI - namespace URIXMLStreamExceptionprotected abstract void writeData(Object data, int type) throws XMLStreamException
data - text/datatype - one of CHARACTERS, COMMENT, CDATA, DTD, ENTITY_REFERENCE, SPACEXMLStreamExceptionprotected abstract void writePI(String target, String data) throws XMLStreamException
target - PI targetdata - PI data (may be null)XMLStreamExceptionpublic void writeStartElement(String localName) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String namespaceURI, String localName) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEndElement()
throws XMLStreamException
writeEndElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionprotected final void writeCharacters(Object data, int type) throws XMLStreamException
XMLStreamExceptionpublic void writeCharacters(String text) throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic void writeCharacters(char[] text,
int start,
int length)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic void writeCData(String data) throws XMLStreamException
writeCData 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 writeEndDocument()
throws XMLStreamException
writeEndDocument in interface XMLStreamWriterXMLStreamExceptionpublic void close()
throws XMLStreamException
close in interface XMLStreamWriterXMLStreamExceptionpublic void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException
writeNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void writeDefaultNamespace(String namespaceURI) throws XMLStreamException
writeDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic String getPrefix(String namespaceURI) throws XMLStreamException
getPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void setPrefix(String prefix, String namespaceURI) throws XMLStreamException
setPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void setDefaultNamespace(String namespaceURI) throws XMLStreamException
setDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void setNamespaceContext(NamespaceContext context) throws XMLStreamException
setNamespaceContext in interface XMLStreamWriterXMLStreamExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamWriterpublic 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 writeDTD(String dtd) throws XMLStreamException
writeDTD in interface XMLStreamWriterXMLStreamExceptionpublic void writeEntityRef(String name) throws XMLStreamException
writeEntityRef in interface XMLStreamWriterXMLStreamExceptionpublic Object getProperty(String name) throws IllegalArgumentException
getProperty in interface XMLStreamWriterIllegalArgumentExceptionCopyright © 2005–2019 Apache Software Foundation. All rights reserved.