Class AbortablePrintWriter

java.lang.Object
java.io.Writer
java.io.PrintWriter
com.google.gwt.codegen.server.AbortablePrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class AbortablePrintWriter extends PrintWriter
Wrapper for a PrintWriter that adds the ability to abort creation and an onClose hook

Experimental API - subject to change.

  • Constructor Details

    • AbortablePrintWriter

      public AbortablePrintWriter(PrintWriter pw)
      Wrap a PrintWriter 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class PrintWriter
    • onClose

      protected void onClose(boolean aborted)
      Called exactly once when this PrintWriter is closed or aborted.
      Parameters:
      aborted -