org.jibx.extras
Class JDOMWriter

java.lang.Object
  extended by org.jibx.runtime.impl.XMLWriterNamespaceBase
      extended by org.jibx.extras.JDOMWriter
All Implemented Interfaces:
IXMLWriter

public class JDOMWriter
extends XMLWriterNamespaceBase

JDOM implementation of XML writer interface. The Document that is created can be accessed by using getDocument().

Version:
1.0
Author:
Andreas Brenk

Field Summary
 
Fields inherited from class org.jibx.runtime.impl.XMLWriterNamespaceBase
m_prefixes, m_uris
 
Constructor Summary
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
 void addAttribute(int index, String name, String value)
           
 void close()
          Does nothing.
 void closeEmptyTag()
           
 void closeStartTag()
           
protected  void defineNamespace(int index, String prefix)
          Does nothing.
 void endTag(int index, String name)
           
 void flush()
          Does nothing.
 org.jdom.Document getDocument()
           
 void indent()
          Does nothing.
 void init()
          Does nothing.
 void reset()
           
 void setIndentSpaces(int count, String newline, char indent)
          Does nothing.
 void startTagClosed(int index, String name)
           
 void startTagNamespaces(int index, String name, int[] nums, String[] prefs)
           
 void startTagOpen(int index, String name)
           
protected  void undefineNamespace(int index)
          Does nothing.
 void writeCData(String text)
           
 void writeComment(String text)
           
 void writeDocType(String name, String sys, String pub, String subset)
           
 void writeEntityRef(String name)
           
 void writePI(String target, String data)
           
 void writeTextContent(String text)
           
 void writeXMLDecl(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDOMWriter

public JDOMWriter(String[] namespaces)
Creates a new instance with the given namespace URIs.


JDOMWriter

public JDOMWriter(String[] namespaces,
                  org.jdom.Document document)
Creates a new instance with the given Document as target for marshalling.

Parameters:
document - 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:
currentElement - 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 IOException
Does nothing.

Throws:
IOException

flush

public void flush()
           throws IOException
Does nothing.

Throws:
IOException

close

public void close()
           throws IOException
Does nothing.

Throws:
IOException

reset

public void reset()
Specified by:
reset in interface IXMLWriter
Overrides:
reset in class XMLWriterNamespaceBase

getDocument

public org.jdom.Document getDocument()
Returns:
the JDOM Document this writer created.

defineNamespace

protected void defineNamespace(int index,
                               String prefix)
                        throws IOException
Does nothing.

Specified by:
defineNamespace in class XMLWriterNamespaceBase
Throws:
IOException

undefineNamespace

protected void undefineNamespace(int index)
Does nothing.

Specified by:
undefineNamespace in class XMLWriterNamespaceBase


Copyright © 2005-2011 jibx.org. All Rights Reserved.