Interface ClipboardFormat

All Known Implementing Classes:
BuiltInClipboardFormat

public interface ClipboardFormat
A collection of supported clipboard formats.
  • Method Details

    • getName

      String getName()
      Returns the name of this format.
      Returns:
      The name of the format
    • getAliases

      Set<String> getAliases()
      Get a set of aliases.
      Returns:
      a set of aliases
    • getReader

      ClipboardReader getReader(InputStream inputStream) throws IOException
      Create a reader.
      Parameters:
      inputStream - the input stream
      Returns:
      a reader
      Throws:
      IOException - thrown on I/O error
    • getWriter

      ClipboardWriter getWriter(OutputStream outputStream) throws IOException
      Create a writer.
      Parameters:
      outputStream - the output stream
      Returns:
      a writer
      Throws:
      IOException - thrown on I/O error
    • isFormat

      default boolean isFormat(File file)
      Return whether the given file is of this format.
      Parameters:
      file - the file
      Returns:
      true if the given file is of this format
    • isFormat

      default boolean isFormat(InputStream inputStream)
      Return whether the given stream is of this format.
      Parameters:
      inputStream - The stream
      Returns:
      true if the given stream is of this format
      Since:
      2.11.1
      API Note:
      The caller is responsible for the following:
      • Closing the input stream
    • getPrimaryFileExtension

      String getPrimaryFileExtension()
      Get the file extension this format primarily uses.
      Returns:
      The primary file extension
    • getFileExtensions

      Set<String> getFileExtensions()
      Get the file extensions this format is commonly known to use. This should include getPrimaryFileExtension().
      Returns:
      The file extensions this format might be known by
    • getExplicitFileExtensions

      Set<String> getExplicitFileExtensions()
      Get the explicit file extensions (e.g. .schem2) this format is commonly known to use.
      Returns:
      The explicit file extensions this format might be known by
    • hold

      default URIClipboardHolder hold(Actor actor, URI uri, InputStream inputStream) throws IOException
      Sets the actor's clipboard.
      Parameters:
      actor - the actor
      uri - the URI of the schematic to hold
      inputStream - the input stream
      Throws:
      IOException - thrown on I/O error
    • load

      default Clipboard load(File file) throws IOException
      Throws:
      IOException
    • load

      default Clipboard load(InputStream stream) throws IOException
      Throws:
      IOException
    • upload

      default URL upload(Clipboard clipboard)
    • write

      default void write(OutputStream value, Clipboard clipboard)