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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Abort creation of this output.void
close()
protected void
onClose
(boolean aborted) Called exactly once when thisPrintWriter
is 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, write
Methods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
AbortablePrintWriter
Wrap aPrintWriter
instance.- 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classPrintWriter
-
onClose
protected void onClose(boolean aborted) Called exactly once when thisPrintWriter
is closed or aborted.- Parameters:
aborted
-
-