public abstract class XMLWriterBase extends XMLWriterNamespaceBase implements IExtensibleWriter
m_prefixes, m_uris| Constructor and Description |
|---|
XMLWriterBase(String[] uris)
Constructor.
|
XMLWriterBase(XMLWriterBase base,
String[] uris)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(int index,
String name,
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,
String name)
Generate end tag.
|
protected void |
flagContent()
Set up for writing any content to element.
|
protected void |
flagTextContent()
Set up for writing text content to element.
|
abstract void |
flush()
Flush document output.
|
protected abstract void |
indent(int bias)
Request output indent with bias from current element nesting level.
|
void |
init()
Initialize writer.
|
void |
reset()
Reset to initial state for reuse.
|
void |
startTagClosed(int index,
String name)
Generate closed start tag.
|
void |
startTagNamespaces(int index,
String name,
int[] nums,
String[] prefs)
Generate start tag for element with namespaces.
|
void |
startTagOpen(int index,
String name)
Generate open start tag.
|
protected abstract void |
writeAttributeText(String text)
Write attribute text to output.
|
void |
writeComment(String text)
Write comment to document.
|
void |
writeDocType(String name,
String sys,
String pub,
String subset)
Write DOCTYPE declaration to document.
|
void |
writeEntityRef(String name)
Write entity reference to document.
|
protected abstract void |
writeMarkup(char chr)
Write markup character to output.
|
protected abstract void |
writeMarkup(String text)
Write markup text to output.
|
void |
writePI(String target,
String data)
Write processing instruction to document.
|
protected abstract void |
writePrefix(int index)
Write namespace prefix to output.
|
void |
writeXMLDecl(String version,
String encoding,
String standalone)
Write XML declaration to document.
|
decrementNesting, defineNamespace, getExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, growArray, incrementNesting, internalNamespacePrefix, internalNamespaceUri, internalSetUris, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, shrinkArray, translateNamespace, undefineNamespaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateChildWritergetExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, indent, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, setIndentSpaces, writeCData, writeTextContentpublic XMLWriterBase(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, String[] uris)
base - existing instanceuris - ordered array of URIs for namespaces used in documentprotected abstract void writeMarkup(String text) throws IOException
text - markup text to be writtenIOException - if error writing to documentprotected abstract void writeMarkup(char chr)
throws IOException
chr - markup character to be writtenIOException - if error writing to documentprotected abstract void writePrefix(int index)
throws IOException
index - namespace URI index numberIOException - if error writing to documentprotected abstract void writeAttributeText(String text) throws IOException
text - attribute value text to be writtenIOException - if error writing to documentprotected abstract void indent(int bias)
throws IOException
IOException - on error writing to documentprotected final void flagContent()
throws IOException
IOException - on error writing to documentprotected final void flagTextContent()
throws IOException
IOException - on error writing to documentpublic void init()
init in interface IXMLWriterpublic void writeXMLDecl(String version, String encoding, String standalone) throws IOException
writeXMLDecl in interface IXMLWriterversion - XML version textencoding - text for encoding attribute (unspecified if
null)standalone - text for standalone attribute (unspecified if
null)IOException - on error writing to documentpublic void startTagOpen(int index,
String name)
throws IOException
closeStartTag() call.startTagOpen in interface IXMLWriterindex - namespace URI index numbername - unqualified element nameIOException - on error writing to documentpublic void startTagNamespaces(int index,
String name,
int[] nums,
String[] prefs)
throws 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)IOException - on error writing to documentpublic void addAttribute(int index,
String name,
String value)
throws 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 attributeIOException - on error writing to documentpublic void closeStartTag()
throws IOException
startTagOpen(int, java.lang.String).closeStartTag in interface IXMLWriterIOException - on error writing to documentpublic void closeEmptyTag()
throws IOException
startTagOpen(int, java.lang.String).closeEmptyTag in interface IXMLWriterIOException - on error writing to documentpublic void startTagClosed(int index,
String name)
throws IOException
startTagClosed in interface IXMLWriterindex - namespace URI index numbername - unqualified element nameIOException - on error writing to documentpublic void endTag(int index,
String name)
throws IOException
endTag in interface IXMLWriterindex - namespace URI index numbername - unqualified element nameIOException - on error writing to documentpublic void writeComment(String text) throws IOException
writeComment in interface IXMLWritertext - comment textIOException - on error writing to documentpublic void writeEntityRef(String name) throws IOException
writeEntityRef in interface IXMLWritername - entity nameIOException - on error writing to documentpublic void writeDocType(String name, String sys, String pub, String subset) throws 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)IOException - on error writing to documentpublic void writePI(String target, String data) throws IOException
writePI in interface IXMLWritertarget - processing instruction target namedata - processing instruction dataIOException - on error writing to documentpublic abstract void flush()
throws IOException
flagContent().flush in interface IXMLWriterIOException - on error writing to documentpublic abstract void close()
throws IOException
close in interface IXMLWriterIOException - on error writing to documentpublic void reset()
reset in interface IXMLWriterreset in class XMLWriterNamespaceBaseCopyright © 2005-2013 jibx.org. All Rights Reserved.