public class StAXWriter extends XMLWriterNamespaceBase implements IExtensibleWriter
m_prefixes, m_uris| Constructor and Description |
|---|
StAXWriter(StAXWriter base,
String[] uris)
Copy constructor.
|
StAXWriter(String[] uris)
Constructor.
|
StAXWriter(String[] uris,
javax.xml.stream.XMLStreamWriter wrtr)
Constructor with writer supplied.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(int index,
String name,
String value)
Add attribute to current open start tag.
|
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.
|
IXMLWriter |
createChildWriter(String[] uris)
Create a child writer instance to be used for a separate binding.
|
protected void |
defineNamespace(int index,
String prefix)
Report to subclass that namespace has been defined.
|
void |
endTag(int index,
String name)
Generate end tag.
|
void |
flush()
Flush document output.
|
void |
indent()
Request output indent.
|
void |
init()
Initialize writer.
|
void |
setIndentSpaces(int count,
String newline,
char indent)
Set nesting indentation.
|
void |
setWriter(javax.xml.stream.XMLStreamWriter wrtr)
Set StAX writer.
|
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 void |
undefineNamespace(int index)
Report to subclass that namespace has been undefined.
|
void |
writeCData(String text)
Write CDATA text to document.
|
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.
|
void |
writePI(String target,
String data)
Write processing instruction to document.
|
void |
writeTextContent(String text)
Write ordinary character data text content to document.
|
void |
writeXMLDecl(String version,
String encoding,
String standalone)
Write XML declaration to document.
|
decrementNesting, getExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, growArray, incrementNesting, internalNamespacePrefix, internalNamespaceUri, internalSetUris, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, reset, shrinkArray, translateNamespaceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, resetpublic StAXWriter(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 StAXWriter(String[] uris, javax.xml.stream.XMLStreamWriter wrtr)
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")wrtr - StAX writer for parse event outputpublic StAXWriter(StAXWriter base, String[] uris)
base - existing instanceuris - ordered array of URIs for namespaces used in documentpublic void init()
init in interface IXMLWriterpublic void setWriter(javax.xml.stream.XMLStreamWriter wrtr)
wrtr - StAX writer for parse event outputprotected void defineNamespace(int index,
String prefix)
throws IOException
XMLWriterNamespaceBasedefineNamespace in class XMLWriterNamespaceBaseindex - post-translation namespace URI index numberprefix - prefix used for namespaceIOException - if error writing to documentprotected void undefineNamespace(int index)
XMLWriterNamespaceBaseundefineNamespace in class XMLWriterNamespaceBaseindex - post-translation namespace URI index numberpublic void setIndentSpaces(int count,
String newline,
char indent)
IXMLWritersetIndentSpaces in interface IXMLWritercount - number of character to indent per level, or disable
indentation if negative (zero means new line only)newline - sequence of characters used for a line ending
(null means use the single character '\n')indent - whitespace character used for indentationpublic void writeXMLDecl(String version, String encoding, String standalone) throws IOException
IXMLWriterwriteXMLDecl 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
IXMLWriterIXMLWriter.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
IXMLWriterstartTagNamespaces 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
IXMLWriterIXMLWriter.startTagOpen(int, java.lang.String) and before the corresponding call to IXMLWriter.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
IXMLWriterIXMLWriter.startTagOpen(int, java.lang.String).closeStartTag in interface IXMLWriterIOException - on error writing to documentpublic void closeEmptyTag()
throws IOException
IXMLWriterIXMLWriter.startTagOpen(int, java.lang.String).closeEmptyTag in interface IXMLWriterIOException - on error writing to documentpublic void startTagClosed(int index,
String name)
throws IOException
IXMLWriterstartTagClosed in interface IXMLWriterindex - namespace URI index numbername - unqualified element nameIOException - on error writing to documentpublic void endTag(int index,
String name)
throws IOException
IXMLWriterendTag in interface IXMLWriterindex - namespace URI index numbername - unqualified element nameIOException - on error writing to documentpublic void writeTextContent(String text) throws IOException
IXMLWriterwriteTextContent in interface IXMLWritertext - content value text (must not be null)IOException - on error writing to documentpublic void writeCData(String text) throws IOException
IXMLWriterwriteCData in interface IXMLWritertext - content value text (must not be null)IOException - on error writing to documentpublic void writeComment(String text) throws IOException
IXMLWriterwriteComment in interface IXMLWritertext - comment text (must not be null)IOException - on error writing to documentpublic void writeEntityRef(String name) throws IOException
IXMLWriterwriteEntityRef in interface IXMLWritername - entity name (must not be null)IOException - on error writing to documentpublic void writeDocType(String name, String sys, String pub, String subset) throws IOException
IXMLWriterwriteDocType 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
IXMLWriterwritePI in interface IXMLWritertarget - processing instruction target name (must not be
null)data - processing instruction data (must not be null)IOException - on error writing to documentpublic void indent()
throws IOException
IXMLWriterindent in interface IXMLWriterIOException - on error writing to documentpublic void flush()
throws IOException
IXMLWriterflush in interface IXMLWriterIOException - on error writing to documentpublic void close()
throws IOException
IXMLWriterclose in interface IXMLWriterIOException - on error writing to documentpublic IXMLWriter createChildWriter(String[] uris)
createChildWriter in interface IExtensibleWriteruris - ordered array of URIs for namespaces used in document
(see StAXWriter(String[]))Copyright © 2005-2013 jibx.org. All Rights Reserved.