Package org.jibx.extras
Class JDOMWriter
- java.lang.Object
-
- org.jibx.runtime.impl.XMLWriterNamespaceBase
-
- org.jibx.extras.JDOMWriter
-
- All Implemented Interfaces:
org.jibx.runtime.IXMLWriter
public class JDOMWriter extends org.jibx.runtime.impl.XMLWriterNamespaceBaseJDOM implementation of XML writer interface. TheDocumentthat is created can be accessed by usinggetDocument().- Version:
- 1.0
- Author:
- Andreas Brenk
-
-
Constructor Summary
Constructors Constructor Description JDOMWriter(String[] namespaces)Creates a new instance with the given namespace URIs.JDOMWriter(String[] namespaces, org.jdom.Document document)Creates a new instance with the given Document as target for marshalling.JDOMWriter(String[] namespaces, org.jdom.Element currentElement)Creates a new instance with the given Element as target for marshalling.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(int index, String name, String value)voidclose()Does nothing.voidcloseEmptyTag()voidcloseStartTag()protected voiddefineNamespace(int index, String prefix)Does nothing.voidendTag(int index, String name)voidflush()Does nothing.org.jdom.DocumentgetDocument()voidindent()Does nothing.voidinit()Does nothing.voidreset()voidsetIndentSpaces(int count, String newline, char indent)Does nothing.voidstartTagClosed(int index, String name)voidstartTagNamespaces(int index, String name, int[] nums, String[] prefs)voidstartTagOpen(int index, String name)protected voidundefineNamespace(int index)Does nothing.voidwriteCData(String text)voidwriteComment(String text)voidwriteDocType(String name, String sys, String pub, String subset)voidwriteEntityRef(String name)voidwritePI(String target, String data)voidwriteTextContent(String text)voidwriteXMLDecl(String version, String encoding, String standalone)Does nothing.-
Methods inherited from class org.jibx.runtime.impl.XMLWriterNamespaceBase
decrementNesting, getExtensionNamespaces, getNamespaceCount, getNamespacePrefix, getNamespaces, getNamespaceUri, getNestingDepth, getPrefixIndex, growArray, incrementNesting, internalNamespacePrefix, internalNamespaceUri, internalSetUris, openNamespaces, popExtensionNamespaces, popTranslationTable, pushExtensionNamespaces, pushTranslationTable, shrinkArray, translateNamespace
-
-
-
-
Constructor Detail
-
JDOMWriter
public JDOMWriter(String[] namespaces)
Creates a new instance with the given namespace URIs.- Parameters:
namespaces- namespaces
-
JDOMWriter
public JDOMWriter(String[] namespaces, org.jdom.Document document)
Creates a new instance with the given Document as target for marshalling.- Parameters:
namespaces- Namespaces listdocument- must not be null
-
JDOMWriter
public JDOMWriter(String[] namespaces, org.jdom.Element currentElement)
Creates a new instance with the given Element as target for marshalling.- Parameters:
namespaces- Namespaces listcurrentElement- must not be null
-
-
Method Detail
-
init
public void init()
Does nothing.
-
setIndentSpaces
public void setIndentSpaces(int count, String newline, char indent)Does nothing.
-
writeXMLDecl
public void writeXMLDecl(String version, String encoding, String standalone) throws IOException
Does nothing.- Throws:
IOException
-
startTagOpen
public void startTagOpen(int index, String name) throws IOException- Throws:
IOException
-
startTagNamespaces
public void startTagNamespaces(int index, String name, int[] nums, String[] prefs) throws IOException- Throws:
IOException
-
addAttribute
public void addAttribute(int index, String name, String value) throws IOException- Throws:
IOException
-
closeStartTag
public void closeStartTag() throws IOException- Throws:
IOException
-
closeEmptyTag
public void closeEmptyTag() throws IOException- Throws:
IOException
-
startTagClosed
public void startTagClosed(int index, String name) throws IOException- Throws:
IOException
-
endTag
public void endTag(int index, String name) throws IOException- Throws:
IOException
-
writeTextContent
public void writeTextContent(String text) throws IOException
- Throws:
IOException
-
writeCData
public void writeCData(String text) throws IOException
- Throws:
IOException
-
writeComment
public void writeComment(String text) throws IOException
- Throws:
IOException
-
writeEntityRef
public void writeEntityRef(String name) throws IOException
- Throws:
IOException
-
writeDocType
public void writeDocType(String name, String sys, String pub, String subset) throws IOException
- Throws:
IOException
-
writePI
public void writePI(String target, String data) throws IOException
- Throws:
IOException
-
indent
public void indent() throws IOExceptionDoes nothing.- Throws:
IOException
-
flush
public void flush() throws IOExceptionDoes nothing.- Throws:
IOException
-
close
public void close() throws IOExceptionDoes nothing.- Throws:
IOException
-
reset
public void reset()
- Specified by:
resetin interfaceorg.jibx.runtime.IXMLWriter- Overrides:
resetin classorg.jibx.runtime.impl.XMLWriterNamespaceBase
-
getDocument
public org.jdom.Document getDocument()
- Returns:
- the JDOM
Documentthis writer created.
-
defineNamespace
protected void defineNamespace(int index, String prefix) throws IOExceptionDoes nothing.- Specified by:
defineNamespacein classorg.jibx.runtime.impl.XMLWriterNamespaceBase- Throws:
IOException
-
undefineNamespace
protected void undefineNamespace(int index)
Does nothing.- Specified by:
undefineNamespacein classorg.jibx.runtime.impl.XMLWriterNamespaceBase
-
-