Interface ClipboardFormat
- All Known Implementing Classes:
BuiltInClipboardFormat
public interface ClipboardFormat
A collection of supported clipboard formats.
-
Method Summary
Modifier and TypeMethodDescriptionGet a set of aliases.Get the explicit file extensions (e.g.Get the file extensions this format is commonly known to use.getName()
Returns the name of this format.Get the file extension this format primarily uses.getReader
(InputStream inputStream) Create a reader.getWriter
(OutputStream outputStream) Create a writer.default URIClipboardHolder
hold
(Actor actor, URI uri, InputStream inputStream) Sets the actor's clipboard.default boolean
Return whether the given file is of this format.default boolean
isFormat
(InputStream inputStream) Return whether the given stream is of this format.default Clipboard
default Clipboard
load
(InputStream stream) default URL
default void
write
(OutputStream value, Clipboard clipboard)
-
Method Details
-
getName
String getName()Returns the name of this format.- Returns:
- The name of the format
-
getAliases
Get a set of aliases.- Returns:
- a set of aliases
-
getReader
Create a reader.- Parameters:
inputStream
- the input stream- Returns:
- a reader
- Throws:
IOException
- thrown on I/O error
-
getWriter
Create a writer.- Parameters:
outputStream
- the output stream- Returns:
- a writer
- Throws:
IOException
- thrown on I/O error
-
isFormat
Return whether the given file is of this format.- Parameters:
file
- the file- Returns:
- true if the given file is of this format
-
isFormat
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
Get the file extensions this format is commonly known to use. This should includegetPrimaryFileExtension()
.- Returns:
- The file extensions this format might be known by
-
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
Sets the actor's clipboard.- Parameters:
actor
- the actoruri
- the URI of the schematic to holdinputStream
- the input stream- Throws:
IOException
- thrown on I/O error
-
load
- Throws:
IOException
-
load
- Throws:
IOException
-
upload
-
write
-