com.generationjava.io.xml
Class AbstractXmlWriter

java.lang.Object
  extended by com.generationjava.io.xml.AbstractXmlWriter
All Implemented Interfaces:
XmlWriter
Direct Known Subclasses:
SimpleXmlWriter, XmlEncXmlWriter

public abstract class AbstractXmlWriter
extends Object
implements XmlWriter

Provides a few method implementations for XmlWriter implementations. The method implementations all depend on other methods which must be implemented.


Constructor Summary
AbstractXmlWriter()
           
 
Method Summary
 XmlWriter writeEmptyEntity(String name)
          A helper method.
 XmlWriter writeEntityWithText(String name, Object text)
          A helper method.
 XmlWriter writeXmlVersion()
          Makes it easy to output the xml version if such a thing is desired.
 XmlWriter writeXmlVersion(String version, String encoding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.generationjava.io.xml.XmlWriter
close, endEntity, getWriter, writeAttribute, writeCData, writeComment, writeEntity, writeText, writeXmlVersion
 

Constructor Detail

AbstractXmlWriter

public AbstractXmlWriter()
Method Detail

writeXmlVersion

public XmlWriter writeXmlVersion()
                          throws IOException
Makes it easy to output the xml version if such a thing is desired. While it usually is desired, it is less surprising not to handle it.

Specified by:
writeXmlVersion in interface XmlWriter
Throws:
IOException

writeXmlVersion

public XmlWriter writeXmlVersion(String version,
                                 String encoding)
                          throws IOException
Specified by:
writeXmlVersion in interface XmlWriter
Throws:
IOException
See Also:
XmlWriter.writeXmlVersion(String, String, String)

writeEntityWithText

public XmlWriter writeEntityWithText(String name,
                                     Object text)
                              throws IOException
A helper method. It writes out an entity which contains only text.

Specified by:
writeEntityWithText in interface XmlWriter
Parameters:
name - String name of tag
text - String of text to go inside the tag
Throws:
IOException

writeEmptyEntity

public XmlWriter writeEmptyEntity(String name)
                           throws IOException
A helper method. It writes out empty entities.

Specified by:
writeEmptyEntity in interface XmlWriter
Parameters:
name - String name of tag
Throws:
IOException


Copyright © 2000-2007 OSJava. All Rights Reserved.