org.quattor.pan.output
Class PanTxtFormatter

java.lang.Object
  extended by org.quattor.pan.output.PanTxtFormatter
All Implemented Interfaces:
Formatter
Direct Known Subclasses:
TxtFormatter

public abstract class PanTxtFormatter
extends java.lang.Object
implements Formatter


Constructor Summary
PanTxtFormatter()
           
 
Method Summary
 void readChild(Element element, java.io.PrintWriter ps, int level, java.lang.String name)
          Reads each child.
 java.lang.String tabMaker(int n)
          Calculates the number of tabulations to write at the begining of a line
abstract  void write(Element root, java.lang.String rootName, java.io.PrintWriter ps)
          Reads the configuration tree and writes it in an xml file.
abstract  void writeBegin(java.io.PrintWriter ps, java.lang.String nbTab, java.lang.String name, int level, java.lang.String type)
          Writes in the PrintWriter.
abstract  void writeEnd(java.io.PrintWriter ps, java.lang.String nbTab, java.lang.String type)
          Writes end tags in the PrintWriter for PanFormatter.
abstract  void writeProperties(java.io.PrintWriter ps, java.lang.String nbTab, java.lang.String name, java.lang.String type, java.lang.String value)
          Writes in the PrintWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.quattor.pan.output.Formatter
getFileExtension, getFormatKey
 

Constructor Detail

PanTxtFormatter

public PanTxtFormatter()
Method Detail

write

public abstract void write(Element root,
                           java.lang.String rootName,
                           java.io.PrintWriter ps)
Reads the configuration tree and writes it in an xml file.

Specified by:
write in interface Formatter
Parameters:
root - root element of the tree
rootName - name of the root element
ps - the PrintWriter

readChild

public void readChild(Element element,
                      java.io.PrintWriter ps,
                      int level,
                      java.lang.String name)
Reads each child.

Parameters:
element - element to treat
ps - PrintWriter
level - Level of the node in the tree
name - name of the element

writeBegin

public abstract void writeBegin(java.io.PrintWriter ps,
                                java.lang.String nbTab,
                                java.lang.String name,
                                int level,
                                java.lang.String type)
Writes in the PrintWriter.

Parameters:
ps - PrintWriter
nbTab - number of tab to write before text
name - name of the element
level - level of the node in the tree
type - type of the element

writeEnd

public abstract void writeEnd(java.io.PrintWriter ps,
                              java.lang.String nbTab,
                              java.lang.String type)
Writes end tags in the PrintWriter for PanFormatter.

Parameters:
ps - PrintWriter
nbTab - number of tab to write before text
type - type of the element

writeProperties

public abstract void writeProperties(java.io.PrintWriter ps,
                                     java.lang.String nbTab,
                                     java.lang.String name,
                                     java.lang.String type,
                                     java.lang.String value)
Writes in the PrintWriter.

Parameters:
ps - PrintWriter
nbTab - number of tab to write before text
name - name of the element
type - type of the element
value - value of the element

tabMaker

public java.lang.String tabMaker(int n)
Calculates the number of tabulations to write at the begining of a line

Parameters:
n - number of tabulations


Copyright © 2011 Quattor. All Rights Reserved.