org.quattor.pan.output
Class TxtFormatter

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

public class TxtFormatter
extends PanTxtFormatter


Method Summary
 java.lang.String getFileExtension()
          Return the file extension for files written with this formatter.
 java.lang.String getFormatKey()
          Returns the name of the formatter that will be used to identify it.
static TxtFormatter getInstance()
          creation of a singleton
 void write(Element root, java.lang.String rootname, java.io.PrintWriter ps)
          Reads the configuration tree and writes it in an xml file.
 void writeBegin(java.io.PrintWriter ps, java.lang.String nbTab, java.lang.String name, int n, java.lang.String s)
          Writes in the PrintWriter.
 void writeEnd(java.io.PrintWriter ps, java.lang.String s1, java.lang.String s)
          Writes end tags in the PrintWriter for PanFormatter.
 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 org.quattor.pan.output.PanTxtFormatter
readChild, tabMaker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TxtFormatter getInstance()
creation of a singleton


getFileExtension

public java.lang.String getFileExtension()
Description copied from interface: Formatter
Return the file extension for files written with this formatter. The implementation may not return null.

Returns:
String containing the file extension to use

getFormatKey

public java.lang.String getFormatKey()
Description copied from interface: Formatter
Returns the name of the formatter that will be used to identify it. This key is used as the value for the command line and for the ant task. The returned key must not be null.

Returns:
String identifying this formatter

write

public void write(Element root,
                  java.lang.String rootname,
                  java.io.PrintWriter ps)
Description copied from class: PanTxtFormatter
Reads the configuration tree and writes it in an xml file.

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

writeBegin

public void writeBegin(java.io.PrintWriter ps,
                       java.lang.String nbTab,
                       java.lang.String name,
                       int n,
                       java.lang.String s)
Description copied from class: PanTxtFormatter
Writes in the PrintWriter.

Specified by:
writeBegin in class PanTxtFormatter
Parameters:
ps - PrintWriter
nbTab - number of tab to write before text
name - name of the element
n - level of the node in the tree
s - type of the element

writeEnd

public void writeEnd(java.io.PrintWriter ps,
                     java.lang.String s1,
                     java.lang.String s)
Description copied from class: PanTxtFormatter
Writes end tags in the PrintWriter for PanFormatter.

Specified by:
writeEnd in class PanTxtFormatter
Parameters:
ps - PrintWriter
s1 - number of tab to write before text
s - type of the element

writeProperties

public void writeProperties(java.io.PrintWriter ps,
                            java.lang.String nbTab,
                            java.lang.String name,
                            java.lang.String type,
                            java.lang.String value)
Description copied from class: PanTxtFormatter
Writes in the PrintWriter.

Specified by:
writeProperties in class PanTxtFormatter
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


Copyright © 2011 Quattor. All Rights Reserved.