epfl.io
Class TagWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.PrintWriter
              |
              +--epfl.io.TagWriter

public class TagWriter
extends java.io.PrintWriter

A simple tag writer.


Inner Class Summary
static class TagWriter.Indent
          A class representing an indentation
 
Constructor Summary
TagWriter(java.io.OutputStream out)
          Creates a new tag writer on the underlying stream without autoflushing
TagWriter(java.io.OutputStream out, boolean autoFlush)
          Creates a new tag writer on the underlying strean
TagWriter(java.io.Writer out)
          Creates a new tag writer on the underlying writer without autoflushing
TagWriter(java.io.Writer out, boolean autoFlush)
          Creates a new tag writer on the underlying writer
 
Method Summary
 void printEndTag(java.lang.String name)
          Writes an end tag
the end tag has the form </name>
 void printEndTagln(java.lang.String name)
          Writes an end tag and ends the current line
 void printIndent(TagWriter.Indent i)
          Writes an indentation
 void printStartTag(java.lang.String name)
          Writes a start tag
the start tag has the form <name>
 void printStartTagln(java.lang.String name)
          Writes a start tag and ends the current line
 void printTag(java.lang.String name, boolean b)
          Writes a boolean tag :
<name>b</name>
 void printTag(java.lang.String name, double d)
          Writes a double tag :
<name>d</name>
 void printTag(java.lang.String name, int i)
          Writes an integer tag :
<name>i</name>
 void printTag(java.lang.String name, long l)
          Writes a long tag :
<name>l</name>
 void printTag(java.lang.String name, java.lang.String ident)
          Writes an identifier tag :
<name>ident</name>
 void printTagln(java.lang.String name, boolean b)
          Writes a boolean tag and ends the current line
 void printTagln(java.lang.String name, double d)
          Writes a double tag and ends the current line
 void printTagln(java.lang.String name, int i)
          Writes an integer tag and ends the current line
 void printTagln(java.lang.String name, long l)
          Writes a long tag and ends the current line
 void printTagln(java.lang.String name, java.lang.String ident)
          Writes an identifier tag and ends the current line
 
Methods inherited from class java.io.PrintWriter
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, write, write, write, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagWriter

public TagWriter(java.io.Writer out)
Creates a new tag writer on the underlying writer without autoflushing

TagWriter

public TagWriter(java.io.Writer out,
                 boolean autoFlush)
Creates a new tag writer on the underlying writer

TagWriter

public TagWriter(java.io.OutputStream out)
Creates a new tag writer on the underlying stream without autoflushing

TagWriter

public TagWriter(java.io.OutputStream out,
                 boolean autoFlush)
Creates a new tag writer on the underlying strean
Method Detail

printIndent

public void printIndent(TagWriter.Indent i)
Writes an indentation

printStartTag

public void printStartTag(java.lang.String name)
Writes a start tag
the start tag has the form <name>

printEndTag

public void printEndTag(java.lang.String name)
Writes an end tag
the end tag has the form </name>

printStartTagln

public void printStartTagln(java.lang.String name)
Writes a start tag and ends the current line

printEndTagln

public void printEndTagln(java.lang.String name)
Writes an end tag and ends the current line

printTag

public void printTag(java.lang.String name,
                     boolean b)
Writes a boolean tag :
<name>b</name>

printTag

public void printTag(java.lang.String name,
                     int i)
Writes an integer tag :
<name>i</name>

printTag

public void printTag(java.lang.String name,
                     long l)
Writes a long tag :
<name>l</name>

printTag

public void printTag(java.lang.String name,
                     double d)
Writes a double tag :
<name>d</name>

printTag

public void printTag(java.lang.String name,
                     java.lang.String ident)
Writes an identifier tag :
<name>ident</name>

printTagln

public void printTagln(java.lang.String name,
                       boolean b)
Writes a boolean tag and ends the current line

printTagln

public void printTagln(java.lang.String name,
                       int i)
Writes an integer tag and ends the current line

printTagln

public void printTagln(java.lang.String name,
                       long l)
Writes a long tag and ends the current line

printTagln

public void printTagln(java.lang.String name,
                       double d)
Writes a double tag and ends the current line

printTagln

public void printTagln(java.lang.String name,
                       java.lang.String ident)
Writes an identifier tag and ends the current line