hmi.xml
Class XMLFormatting

java.lang.Object
  extended by hmi.xml.XMLFormatting

public class XMLFormatting
extends Object

XMLFormatting defines formatting for writing XML structures, such as tabbing and namespace labels

Author:
Job Zwiers

Field Summary
private  XMLNameSpaceStack namespaceStack
           
private  int tab
           
static int TAB
           
private  int tabIncrement
           
private  ArrayList<Integer> tabStack
           
 
Constructor Summary
XMLFormatting()
          Default constructor
XMLFormatting(int tab)
          Constructor specifying a tab setting
 
Method Summary
 int getIndentedTab()
          returns the current tab.
 String getNamespacePrefix(String namespace)
          Returns the prefix currently associated with the specified namespace.
 int getTab()
          returns the current tab.
 int getTabIncrement()
          Returns the increment for the tab() method.
 XMLFormatting indent()
          Push the current tab, then increment the tab with the current tabIncrement.
 XMLFormatting indent(int tabIncrement)
          Push the current tab, then increment the tab with the specified tabIncrement.
 XMLFormatting popXMLNameSpace()
           
 XMLFormatting pushXMLNameSpace(XMLNameSpace xmlNamespace)
           
 void setTabIncrement(int increment)
          Set the increment for the tab() method.
 XMLFormatting unIndent()
          Restore/Pop the current tab setting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tabStack

private ArrayList<Integer> tabStack

namespaceStack

private XMLNameSpaceStack namespaceStack

TAB

public static final int TAB
See Also:
Constant Field Values

tab

private int tab

tabIncrement

private int tabIncrement
Constructor Detail

XMLFormatting

public XMLFormatting()
Default constructor


XMLFormatting

public XMLFormatting(int tab)
Constructor specifying a tab setting

Method Detail

getTab

public int getTab()
returns the current tab.


getIndentedTab

public int getIndentedTab()
returns the current tab.


setTabIncrement

public void setTabIncrement(int increment)
Set the increment for the tab() method.


getTabIncrement

public int getTabIncrement()
Returns the increment for the tab() method.


getNamespacePrefix

public String getNamespacePrefix(String namespace)
Returns the prefix currently associated with the specified namespace. It is assumed that namespace is an "interned" String If there is no associated prefix, null is returned.


pushXMLNameSpace

public XMLFormatting pushXMLNameSpace(XMLNameSpace xmlNamespace)

popXMLNameSpace

public XMLFormatting popXMLNameSpace()

indent

public XMLFormatting indent(int tabIncrement)
Push the current tab, then increment the tab with the specified tabIncrement.


unIndent

public XMLFormatting unIndent()
Restore/Pop the current tab setting.


indent

public XMLFormatting indent()
Push the current tab, then increment the tab with the current tabIncrement.