Package com.google.gwt.codegen.server
Class AbortablePrintWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
com.google.gwt.codegen.server.AbortablePrintWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Wrapper for a
PrintWriter that adds the ability to abort creation
and an onClose hook
Experimental API - subject to change.
-
Field Summary
Fields inherited from class java.io.PrintWriter
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Abort creation of this output.voidclose()protected voidonClose(boolean aborted) Called exactly once when thisPrintWriteris closed or aborted.Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, writeMethods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
AbortablePrintWriter
Wrap aPrintWriterinstance.- Parameters:
pw-- Throws:
RuntimeException- if there are reflection errors accessing the out field in pw
-
-
Method Details
-
abort
public void abort()Abort creation of this output. -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classPrintWriter
-
onClose
protected void onClose(boolean aborted) Called exactly once when thisPrintWriteris closed or aborted.- Parameters:
aborted-
-