org.deckfour.spex
Class SXNode

java.lang.Object
  extended by org.deckfour.spex.SXNode
Direct Known Subclasses:
SXCommentNode, SXDocument, SXTag, SXTextNode

public abstract class SXNode
extends Object

Abstract superclass for nodes in an XML document.

Author:
Christian W. Guenther (christian@deckfour.org)

Field Summary
protected  int tabLevel
          Tabulator indentation level of this node.
protected  String tabString
          Tabulator string.
protected  Writer writer
          Writer used for serializing document.
 
Constructor Summary
protected SXNode(Writer aWriter, int aTabLevel, String aTabString)
          Creates a new node.
 
Method Summary
abstract  void close()
          Explicitly closes this node.
 int getTabLevel()
          Returns the indentation level of this node.
protected  void indentLine()
          Convenience method for indenting a line according to this node's tabulator depth level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tabLevel

protected int tabLevel
Tabulator indentation level of this node.


tabString

protected String tabString
Tabulator string.


writer

protected Writer writer
Writer used for serializing document.

Constructor Detail

SXNode

protected SXNode(Writer aWriter,
                 int aTabLevel,
                 String aTabString)
Creates a new node.

Parameters:
aWriter - The writer used for serializing output.
aTabLevel - Indentation level of this node.
aTabString - Tabulator string used in document.
Method Detail

close

public abstract void close()
                    throws IOException
Explicitly closes this node.

Throws:
IOException

getTabLevel

public int getTabLevel()
Returns the indentation level of this node.

Returns:
The tabulator indentation level of this node.

indentLine

protected void indentLine()
                   throws IOException
Convenience method for indenting a line according to this node's tabulator depth level.

Throws:
IOException