iaik.tc.utils.logging.java12
Class LogPrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by iaik.tc.utils.logging.java12.LogPrintWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class LogPrintWriter
extends java.io.PrintWriter

This class implements a custom PrintWriter that extracts the class name, method name and line number of the caller from the stack trace.


Constructor Summary
LogPrintWriter(java.io.OutputStream out)
          Constructor.
LogPrintWriter(java.io.OutputStream out, boolean autoFlush)
          Constructor.
LogPrintWriter(java.io.Writer out)
          Constructor.
LogPrintWriter(java.io.Writer out, boolean autoFlush)
          Constructor.
 
Method Summary
 java.lang.String getClassName()
          Returns contents of the className field.
 int getLineNumber()
          Returns contents of the lineNumber field.
 java.lang.String getMethodName()
          Returns contents of the methodName field.
 void print(java.lang.String s)
          Overwrites the default implementation and sends the data to the decode method.
 void println(char[] s)
          Overwrites the default implementation and sends the data to the decode method.
 void println(java.lang.String s)
          Overwrites the default implementation and sends the data to the decode method.
 void setCallerStackElement(short callerStackElement)
          Sets the index of the caller stack element.
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, printf, printf, 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

LogPrintWriter

public LogPrintWriter(java.io.Writer out)
Constructor.


LogPrintWriter

public LogPrintWriter(java.io.OutputStream out)
Constructor.


LogPrintWriter

public LogPrintWriter(java.io.Writer out,
                      boolean autoFlush)
Constructor.


LogPrintWriter

public LogPrintWriter(java.io.OutputStream out,
                      boolean autoFlush)
Constructor.

Method Detail

println

public void println(java.lang.String s)
Overwrites the default implementation and sends the data to the decode method.

Overrides:
println in class java.io.PrintWriter

println

public void println(char[] s)
Overwrites the default implementation and sends the data to the decode method.

Overrides:
println in class java.io.PrintWriter

print

public void print(java.lang.String s)
Overwrites the default implementation and sends the data to the decode method.

Overrides:
print in class java.io.PrintWriter

getClassName

public java.lang.String getClassName()
Returns contents of the className field.


getLineNumber

public int getLineNumber()
Returns contents of the lineNumber field.


getMethodName

public java.lang.String getMethodName()
Returns contents of the methodName field.


setCallerStackElement

public void setCallerStackElement(short callerStackElement)
Sets the index of the caller stack element.