to.etc.domui.dom
Class XmlOutputWriterBase

java.lang.Object
  extended by to.etc.domui.dom.XmlOutputWriterBase
Direct Known Subclasses:
FastXmlOutputWriter, PrettyXmlOutputWriter

public class XmlOutputWriterBase
extends java.lang.Object


Field Summary
protected  boolean m_intag
           
 
Constructor Summary
XmlOutputWriterBase(java.io.Writer w)
           
 
Method Summary
 void attr(java.lang.String name, boolean value)
           
 void attr(java.lang.String name, int value)
           
 void attr(java.lang.String name, long value)
          Write a simple numeric attribute thingy.
 void attr(java.lang.String name, java.lang.String value)
          Appends an attribute to the last tag.
 void closetag(java.lang.String name)
           
 void dec()
           
 void endAndCloseXmltag()
          Ends a tag by adding />.
 void endtag()
          Ends a tag by adding a > only.
protected  java.io.Writer getWriter()
           
 void inc()
           
 boolean isIndentEnabled()
           
 void nl()
           
protected  void println()
           
 void rawAttr(java.lang.String name, java.lang.String value)
           
 void tag(java.lang.String tagname)
          Writes a tag start.
 void text(java.lang.String s)
          Writes string data.
 void writeRaw(java.lang.String s)
           
protected  void writeRaw(java.lang.String s, int off, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_intag

protected boolean m_intag
Constructor Detail

XmlOutputWriterBase

public XmlOutputWriterBase(java.io.Writer w)
Method Detail

getWriter

protected java.io.Writer getWriter()

text

public void text(java.lang.String s)
          throws java.io.IOException
Writes string data. This escapes XML control characters to their entity equivalent. This does NOT indent data with newlines, because string data in a content block may not change.

Throws:
java.io.IOException

println

protected void println()
                throws java.io.IOException
Throws:
java.io.IOException

nl

public void nl()
        throws java.io.IOException
Throws:
java.io.IOException

inc

public void inc()

dec

public void dec()

isIndentEnabled

public boolean isIndentEnabled()

tag

public void tag(java.lang.String tagname)
         throws java.io.IOException
Writes a tag start. It can be followed by attr() calls. If the namespace is in the current namespace the tag will not have prefixes.

Parameters:
namespace -
tagname -
Throws:
java.io.IOException

endtag

public void endtag()
            throws java.io.IOException
Ends a tag by adding a > only.

Throws:
java.io.IOException

endAndCloseXmltag

public void endAndCloseXmltag()
                       throws java.io.IOException
Ends a tag by adding />.

Throws:
java.io.IOException

closetag

public void closetag(java.lang.String name)
              throws java.io.IOException
Throws:
java.io.IOException

attr

public void attr(java.lang.String name,
                 java.lang.String value)
          throws java.io.IOException
Appends an attribute to the last tag. The value's characters that are invalid are quoted into entities.

Parameters:
namespace -
name -
value -
Throws:
java.io.IOException

rawAttr

public void rawAttr(java.lang.String name,
                    java.lang.String value)
             throws java.io.IOException
Throws:
java.io.IOException

attr

public void attr(java.lang.String name,
                 long value)
          throws java.io.IOException
Write a simple numeric attribute thingy.

Parameters:
namespace -
name -
value -
Throws:
java.io.IOException

attr

public void attr(java.lang.String name,
                 int value)
          throws java.io.IOException
Throws:
java.io.IOException

attr

public void attr(java.lang.String name,
                 boolean value)
          throws java.io.IOException
Throws:
java.io.IOException

writeRaw

public void writeRaw(java.lang.String s)
              throws java.io.IOException
Throws:
java.io.IOException

writeRaw

protected void writeRaw(java.lang.String s,
                        int off,
                        int len)
                 throws java.io.IOException
Throws:
java.io.IOException