xrel.xml
Class Builder

java.lang.Object
  |
  +--xrel.xml.Builder

public class Builder
extends java.lang.Object

Permits to build an XML document.

Here's a list of methods available:

.. TODO: to complete..

Author:
Fabrizio Bisi

Field Summary
protected  java.io.PrintStream fOut
          Stream to which to print.
 
Constructor Summary
Builder()
           
 
Method Summary
 void addNode(java.lang.String tagName, java.lang.String content)
          Adds a node with a string content on one row.
 void beginNode(java.lang.String tagName)
          Begins a new tag without increase the indentation level and without go to the next line.
 void closeDoc()
          Closes the current document.
 void closeNode(java.lang.String tagName)
          Closes the specified tag and makes the indentation level lower.
 void endNode(java.lang.String tagName)
          Closes the specified tag without decrease the indentation level.
 java.io.PrintStream getPrintStream()
          Returns the stream specfied at the creation of the object.
 void openDoc(java.lang.String filename, java.lang.String rt)
          Creates a new XML document with the specified name and with a root tag with name "rt".
 void openNode(java.lang.String tagName)
          Opens a new tag and makes the indention level higher.
 void writeText(java.lang.String content)
          Writes simple text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fOut

protected java.io.PrintStream fOut
Stream to which to print.
Constructor Detail

Builder

public Builder()
Method Detail

openDoc

public void openDoc(java.lang.String filename,
                    java.lang.String rt)
Creates a new XML document with the specified name and with a root tag with name "rt". Specifically it creates the file, writes the header and opens the root tag.
Parameters:
filename - the name of the XML document
rt - the name of the root node

closeDoc

public void closeDoc()
Closes the current document.

openNode

public void openNode(java.lang.String tagName)
Opens a new tag and makes the indention level higher.
Parameters:
tagName - the name of the tag to open

closeNode

public void closeNode(java.lang.String tagName)
Closes the specified tag and makes the indentation level lower.
Parameters:
tagName - the name of the tag to close

beginNode

public void beginNode(java.lang.String tagName)
Begins a new tag without increase the indentation level and without go to the next line.
Parameters:
tagName - the name of the tag to open

endNode

public void endNode(java.lang.String tagName)
Closes the specified tag without decrease the indentation level.
Parameters:
tagName - the name of the tag to close

addNode

public void addNode(java.lang.String tagName,
                    java.lang.String content)
Adds a node with a string content on one row.
Parameters:
tagName -  
content -  

writeText

public void writeText(java.lang.String content)
Writes simple text.
Parameters:
content -  

getPrintStream

public java.io.PrintStream getPrintStream()
Returns the stream specfied at the creation of the object.
Returns:
the print stream