jimm.twice.xml.dom
Class Element

java.lang.Object
  extended byjimm.twice.xml.dom.Element
Direct Known Subclasses:
NamedElement, Text

public abstract class Element
extends java.lang.Object

The abstract base class of almost all XML entites.

Author:
Jim Menard, jimm@io.com

Field Summary
static int CLOSE_TAG
           
static int OPEN_AND_CLOSE_TAG
           
static int OPEN_TAG
           
 
Constructor Summary
Element()
           
 
Method Summary
 void writeTo(java.io.OutputStream out)
          Writes this element as an XML string.
abstract  void writeTo(java.io.OutputStream out, int openOrClose)
          Writes this element as an XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN_TAG

public static final int OPEN_TAG
See Also:
Constant Field Values

CLOSE_TAG

public static final int CLOSE_TAG
See Also:
Constant Field Values

OPEN_AND_CLOSE_TAG

public static final int OPEN_AND_CLOSE_TAG
See Also:
Constant Field Values
Constructor Detail

Element

public Element()
Method Detail

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Writes this element as an XML string. Calls writeTo(OutputStream, int) with the argument OPEN_AND_CLOSE_TAG.

Parameters:
out - the output writer
Throws:
java.io.IOException
See Also:
writeTo(OutputStream, int)

writeTo

public abstract void writeTo(java.io.OutputStream out,
                             int openOrClose)
                      throws java.io.IOException
Writes this element as an XML string. The parameter openOrClose determines if the open tag (OPEN_TAG), close tag (CLOSE_TAG), or both (OPEN_AND_CLOSE_TAG) should be returned.

Parameters:
out - the output writer
openOrClose - one of OPEN_TAG, CLOSE_TAG, or OPEN_AND_CLOSE_TAG
Throws:
java.io.IOException