org.coode.xml
Interface XMLWriter

All Known Implementing Classes:
XMLWriterImpl

public interface XMLWriter

User: matthewhorridge
The Univeristy Of Manchester
Medical Informatics Group
Date: May 30, 2006

matthew.horridge@cs.man.ac.uk
www.cs.man.ac.uk/~horridgm

Developed as part of the CO-ODE project http://www.co-ode.org


Method Summary
 void endDocument()
          Causes all open elements, including the document root element, to be closed.
 java.lang.String getDefaultNamespace()
          Gets the default namespace that the rdfwriter uses.
 XMLWriterNamespaceManager getNamespacePrefixes()
          Gets the rdfwriter's namespace manager.
 java.lang.String getXMLBase()
           
 void setEncoding(java.lang.String encoding)
          Sets the encoding for the document that the rdfwriter produces.
 void setWrapAttributes(boolean b)
          Causes the current element's attributes to be wrapped in the output.
 void startDocument(java.lang.String rootElementName)
          Starts writing the document.
 void writeAttribute(java.lang.String attr, java.lang.String val)
          Writes an attribute of the last element to be started (that has not been closed).
 void writeComment(java.lang.String commentText)
           
 void writeEndElement()
          Writes the closing tag of the last element to be started.
 void writeStartElement(java.lang.String name)
          Writes the start of an element
 void writeTextContent(java.lang.String text)
          Writes a text element
 

Method Detail

setEncoding

void setEncoding(java.lang.String encoding)
Sets the encoding for the document that the rdfwriter produces. The default encoding is "UTF-8".

Parameters:
encoding - The encoding.

getDefaultNamespace

java.lang.String getDefaultNamespace()
Gets the default namespace that the rdfwriter uses.


getNamespacePrefixes

XMLWriterNamespaceManager getNamespacePrefixes()
Gets the rdfwriter's namespace manager.


getXMLBase

java.lang.String getXMLBase()

setWrapAttributes

void setWrapAttributes(boolean b)
Causes the current element's attributes to be wrapped in the output.


startDocument

void startDocument(java.lang.String rootElementName)
                   throws java.io.IOException
Starts writing the document. The root element will contain the namespace declarations and xml:base attribute.

Parameters:
rootElementName - The name of the root element.
Throws:
java.io.IOException

endDocument

void endDocument()
                 throws java.io.IOException
Causes all open elements, including the document root element, to be closed.

Throws:
java.io.IOException

writeStartElement

void writeStartElement(java.lang.String name)
                       throws java.io.IOException
Writes the start of an element

Parameters:
name - The tag name of the element to be written.
Throws:
java.io.IOException

writeEndElement

void writeEndElement()
                     throws java.io.IOException
Writes the closing tag of the last element to be started.

Throws:
java.io.IOException

writeAttribute

void writeAttribute(java.lang.String attr,
                    java.lang.String val)
                    throws java.io.IOException
Writes an attribute of the last element to be started (that has not been closed).

Parameters:
attr - The name of the attribute
val - The value of the attribute
Throws:
java.io.IOException

writeTextContent

void writeTextContent(java.lang.String text)
                      throws java.io.IOException
Writes a text element

Parameters:
text - The text to be written
Throws:
java.io.IOException

writeComment

void writeComment(java.lang.String commentText)
                  throws java.io.IOException
Throws:
java.io.IOException