org.melati.util
Class ThrowingPrintWriter

Package class diagram package ThrowingPrintWriter
java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by org.melati.util.ThrowingPrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public final class ThrowingPrintWriter
extends PrintWriter

A PrintWriter which can throw an Exception.


Nested Class Summary
static class ThrowingPrintWriter.SuperUseException
          Thrown when a programmer attempts to use super.out.
 class ThrowingPrintWriter.TroubleException
          Thrown if there is a problem writing to this ThowingPrintWriter.
 
Field Summary
 String description
          Description of this PrintWriter.
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
ThrowingPrintWriter(PrintWriter pw, String description)
          Constructor.
 
Method Summary
 boolean checkError()
          Delegated method.
 void close()
          Delegated method.
 void flush()
          Delegated method.
 void println()
          Delegated method.
 void throwOnTrouble()
          Check for problem and throw it if found.
 void write(char[] buf, int off, int len)
          Delegated method.
 void write(int c)
          Delegated method.
 void write(String buf, int off, int len)
          Delegated method.
 
Methods inherited from class java.io.PrintWriter
append, append, append, clearError, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public final String description
Description of this PrintWriter.

Constructor Detail

ThrowingPrintWriter

public ThrowingPrintWriter(PrintWriter pw,
                           String description)
Constructor.

Parameters:
pw - Preint writer to write to
description - A description
Method Detail

throwOnTrouble

public void throwOnTrouble()
Check for problem and throw it if found.


flush

public void flush()
Delegated method.

Specified by:
flush in interface Flushable
Overrides:
flush in class PrintWriter
See Also:
PrintWriter.flush()

close

public void close()
Delegated method.

Specified by:
close in interface Closeable
Overrides:
close in class PrintWriter
See Also:
PrintWriter.close()

checkError

public boolean checkError()
Delegated method.

Overrides:
checkError in class PrintWriter
See Also:
PrintWriter.checkError()

write

public void write(int c)
Delegated method.

Overrides:
write in class PrintWriter
See Also:
PrintWriter.write(int)

write

public void write(char[] buf,
                  int off,
                  int len)
Delegated method.

Overrides:
write in class PrintWriter
See Also:
PrintWriter.write(char[], int, int)

write

public void write(String buf,
                  int off,
                  int len)
Delegated method.

Overrides:
write in class PrintWriter
See Also:
PrintWriter.write(java.lang.String, int, int)

println

public void println()
Delegated method.

Overrides:
println in class PrintWriter
See Also:
PrintWriter.println()


Copyright © 2000-2010 PanEris. All Rights Reserved.