|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jibx.runtime.impl.XMLWriterNamespaceBase org.jibx.extras.JDOMWriter
public class JDOMWriter
JDOM implementation of XML writer interface. The Document
that is
created can be accessed by using getDocument()
.
Constructor Summary | |
---|---|
JDOMWriter(java.lang.String[] namespaces)
Creates a new instance with the given namespace URIs. |
|
JDOMWriter(java.lang.String[] namespaces,
org.jdom.Document document)
Creates a new instance with the given Document as target for marshalling. |
|
JDOMWriter(java.lang.String[] namespaces,
org.jdom.Element currentElement)
Creates a new instance with the given Element as target for marshalling. |
Method Summary | |
---|---|
void |
addAttribute(int index,
java.lang.String name,
java.lang.String value)
Add attribute to current open start tag. |
void |
close()
Does nothing. |
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. |
void |
flush()
Does nothing. |
org.jdom.Document |
getDocument()
|
void |
indent()
Does nothing. |
void |
init()
Does nothing. |
void |
reset()
Reset to initial state for reuse. |
void |
setIndentSpaces(int count,
java.lang.String newline,
char indent)
Does nothing. |
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 |
writeCData(java.lang.String text)
Write CDATA text to document. |
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 |
writeTextContent(java.lang.String text)
Write ordinary character data text content to document. |
void |
writeXMLDecl(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone)
Does nothing. |
Methods inherited from class org.jibx.runtime.impl.XMLWriterNamespaceBase |
---|
getExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, translateNamespace |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDOMWriter(java.lang.String[] namespaces)
public JDOMWriter(java.lang.String[] namespaces, org.jdom.Document document)
document
- must not be nullpublic JDOMWriter(java.lang.String[] namespaces, org.jdom.Element currentElement)
currentElement
- must not be nullMethod Detail |
---|
public void init()
public void setIndentSpaces(int count, java.lang.String newline, char indent)
count
- 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(java.lang.String version, java.lang.String encoding, java.lang.String standalone) throws java.io.IOException
version
- 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
IXMLWriter
IXMLWriter.closeStartTag()
call.
index
- namespace URI index numbername
- unqualified element name
java.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
IXMLWriter
index
- 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
IXMLWriter
IXMLWriter.startTagOpen(int, java.lang.String)
and before the corresponding call to IXMLWriter.closeStartTag()
.
index
- namespace URI index numbername
- unqualified attribute namevalue
- text value for attribute
java.io.IOException
- on error writing to documentpublic void closeStartTag() throws java.io.IOException
IXMLWriter
IXMLWriter.startTagOpen(int, java.lang.String)
.
java.io.IOException
- on error writing to documentpublic void closeEmptyTag() throws java.io.IOException
IXMLWriter
IXMLWriter.startTagOpen(int, java.lang.String)
.
java.io.IOException
- on error writing to documentpublic void startTagClosed(int index, java.lang.String name) throws java.io.IOException
IXMLWriter
index
- namespace URI index numbername
- unqualified element name
java.io.IOException
- on error writing to documentpublic void endTag(int index, java.lang.String name) throws java.io.IOException
IXMLWriter
index
- namespace URI index numbername
- unqualified element name
java.io.IOException
- on error writing to documentpublic void writeTextContent(java.lang.String text) throws java.io.IOException
IXMLWriter
text
- content value text (must not be null
)
java.io.IOException
- on error writing to documentpublic void writeCData(java.lang.String text) throws java.io.IOException
IXMLWriter
text
- content value text (must not be null
)
java.io.IOException
- on error writing to documentpublic void writeComment(java.lang.String text) throws java.io.IOException
IXMLWriter
text
- comment text (must not be null
)
java.io.IOException
- on error writing to documentpublic void writeEntityRef(java.lang.String name) throws java.io.IOException
IXMLWriter
name
- entity name (must not be null
)
java.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
IXMLWriter
name
- 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
IXMLWriter
target
- processing instruction target name (must not be
null
)data
- processing instruction data (must not be null
)
java.io.IOException
- on error writing to documentpublic void indent() throws java.io.IOException
java.io.IOException
- on error writing to documentpublic void flush() throws java.io.IOException
java.io.IOException
- on error writing to documentpublic void close() throws java.io.IOException
java.io.IOException
- on error writing to documentpublic void reset()
XMLWriterNamespaceBase
reset
in interface IXMLWriter
reset
in class XMLWriterNamespaceBase
public org.jdom.Document getDocument()
Document
this writer created.
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |