public abstract class XMLWriterBase extends XMLWriterNamespaceBase implements IExtensibleWriter
| Constructor and Description |
|---|
XMLWriterBase(java.lang.String[] uris)
Constructor.
|
XMLWriterBase(XMLWriterBase base,
java.lang.String[] uris)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(int index,
java.lang.String name,
java.lang.String value)
Add attribute to current open start tag.
|
abstract void |
close()
Close document output.
|
void |
closeEmptyTag()
Close the current open start tag as an empty element.
|
void |
closeStartTag()
Close the current open start tag.
|
void |
endTag(int index,
java.lang.String name)
Generate end tag.
|
abstract void |
flush()
Flush document output.
|
void |
init()
Initialize writer.
|
void |
reset()
Reset to initial state for reuse.
|
void |
startTagClosed(int index,
java.lang.String name)
Generate closed start tag.
|
void |
startTagNamespaces(int index,
java.lang.String name,
int[] nums,
java.lang.String[] prefs)
Generate start tag for element with namespaces.
|
void |
startTagOpen(int index,
java.lang.String name)
Generate open start tag.
|
void |
writeComment(java.lang.String text)
Write comment to document.
|
void |
writeDocType(java.lang.String name,
java.lang.String sys,
java.lang.String pub,
java.lang.String subset)
Write DOCTYPE declaration to document.
|
void |
writeEntityRef(java.lang.String name)
Write entity reference to document.
|
void |
writePI(java.lang.String target,
java.lang.String data)
Write processing instruction to document.
|
void |
writeXMLDecl(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone)
Write XML declaration to document.
|
getExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, translateNamespaceequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateChildWritergetExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, indent, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, setIndentSpaces, writeCData, writeTextContentpublic XMLWriterBase(java.lang.String[] uris)
uris - ordered array of URIs for namespaces used in document (must
be constant; the value in position 0 must always be the empty string "",
and the value in position 1 must always be the XML namespace
"http://www.w3.org/XML/1998/namespace")public XMLWriterBase(XMLWriterBase base, java.lang.String[] uris)
base - existing instanceuris - ordered array of URIs for namespaces used in documentpublic void init()
init in interface IXMLWriterpublic void writeXMLDecl(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone)
throws java.io.IOException
writeXMLDecl in interface IXMLWriterversion - XML version textencoding - text for encoding attribute (unspecified if
null)standalone - text for standalone attribute (unspecified if
null)java.io.IOException - on error writing to documentpublic void startTagOpen(int index,
java.lang.String name)
throws java.io.IOException
closeStartTag() call.startTagOpen in interface IXMLWriterindex - namespace URI index numbername - unqualified element namejava.io.IOException - on error writing to documentpublic void startTagNamespaces(int index,
java.lang.String name,
int[] nums,
java.lang.String[] prefs)
throws java.io.IOException
startTagNamespaces in interface IXMLWriterindex - namespace URI index numbername - element namenums - array of namespace indexes defined by this element (must
be constant, reference is kept until end of element)prefs - array of namespace prefixes mapped by this element (no
null values, use "" for default namespace declaration)java.io.IOException - on error writing to documentpublic void addAttribute(int index,
java.lang.String name,
java.lang.String value)
throws java.io.IOException
startTagOpen(int, java.lang.String) or startTagNamespaces(int, java.lang.String, int[], java.lang.String[]) and before the
corresponding call to closeStartTag().addAttribute in interface IXMLWriterindex - namespace URI index numbername - unqualified attribute namevalue - text value for attributejava.io.IOException - on error writing to documentpublic void closeStartTag()
throws java.io.IOException
startTagOpen(int, java.lang.String).closeStartTag in interface IXMLWriterjava.io.IOException - on error writing to documentpublic void closeEmptyTag()
throws java.io.IOException
startTagOpen(int, java.lang.String).closeEmptyTag in interface IXMLWriterjava.io.IOException - on error writing to documentpublic void startTagClosed(int index,
java.lang.String name)
throws java.io.IOException
startTagClosed in interface IXMLWriterindex - namespace URI index numbername - unqualified element namejava.io.IOException - on error writing to documentpublic void endTag(int index,
java.lang.String name)
throws java.io.IOException
endTag in interface IXMLWriterindex - namespace URI index numbername - unqualified element namejava.io.IOException - on error writing to documentpublic void writeComment(java.lang.String text)
throws java.io.IOException
writeComment in interface IXMLWritertext - comment textjava.io.IOException - on error writing to documentpublic void writeEntityRef(java.lang.String name)
throws java.io.IOException
writeEntityRef in interface IXMLWritername - entity namejava.io.IOException - on error writing to documentpublic void writeDocType(java.lang.String name,
java.lang.String sys,
java.lang.String pub,
java.lang.String subset)
throws java.io.IOException
writeDocType in interface IXMLWritername - root element namesys - system ID (null if none, must be
non-null for public ID to be used)pub - public ID (null if none)subset - internal subset (null if none)java.io.IOException - on error writing to documentpublic void writePI(java.lang.String target,
java.lang.String data)
throws java.io.IOException
writePI in interface IXMLWritertarget - processing instruction target namedata - processing instruction datajava.io.IOException - on error writing to documentpublic abstract void flush()
throws java.io.IOException
flagContent().flush in interface IXMLWriterjava.io.IOException - on error writing to documentpublic abstract void close()
throws java.io.IOException
close in interface IXMLWriterjava.io.IOException - on error writing to documentpublic void reset()
reset in interface IXMLWriterreset in class XMLWriterNamespaceBase