Class PasteFileHandler.SessionBuilder

java.lang.Object
com.vaadin.flow.component.clipboard.PasteFileHandler.SessionBuilder
All Implemented Interfaces:
Serializable
Enclosing class:
PasteFileHandler

public static final class PasteFileHandler.SessionBuilder extends Object implements Serializable
Fluent builder for the session-style paste handler. See PasteFileHandler.session() for the listener semantics. Successive calls to the same onX method overwrite earlier registrations; omitted steps default to no-ops.
See Also:
  • Method Details

    • onStart

      Registers the onStart step, fired once per paste before the paste's first PasteFile is delivered.
      Parameters:
      handler - consumer invoked on the UI thread; pass null to reset to a no-op
      Returns:
      this builder
    • onFile

      Registers the onFile step, fired once per accepted file with the file's bytes and metadata.
      Parameters:
      handler - consumer invoked on the UI thread; pass null to reset to a no-op
      Returns:
      this builder
    • onComplete

      Registers the onComplete step, fired once after the paste's declared file count has been delivered to onFile.
      Parameters:
      handler - consumer invoked on the UI thread; pass null to reset to a no-op
      Returns:
      this builder
    • build

      public UploadHandler build()
      Returns an UploadHandler that orchestrates the configured session steps. The returned handler is independent of this builder; further mutations to the builder do not affect it.