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 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 boolean
Return whether the given file is of this format.default boolean
isFormat
(InputStream inputStream) Return whether the given stream is of this format.
-
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
- 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
-