public interface IContentTypeMatcher
This interface is not intended to be implemented by clients.
IContentTypeManager.getMatcher(IContentTypeManager.ISelectionPolicy, IScopeContext)
Modifier and Type | Method and Description |
---|---|
IContentType |
findContentTypeFor(InputStream contents,
String fileName)
Returns the preferred content type for the given contents and file name.
|
IContentType |
findContentTypeFor(String fileName)
Returns the preferred content type for the given file name.
|
IContentType[] |
findContentTypesFor(InputStream contents,
String fileName)
Returns the content types associated to the given contents and file name.
|
IContentType[] |
findContentTypesFor(String fileName)
Returns all content types known by the platform that are associated to the given file name.
|
IContentDescription |
getDescriptionFor(InputStream contents,
String fileName,
QualifiedName[] options)
Tries to obtain a description for the given contents and file name.
|
IContentDescription |
getDescriptionFor(Reader contents,
String fileName,
QualifiedName[] options)
Tries to obtain a description for the given contents and file name.
|
IContentType findContentTypeFor(InputStream contents, String fileName) throws IOException
Returns null
if no associated content types are
found.
If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.
Any IOExceptions that may occur while reading the given input stream will flow to the caller. The input stream will not be closed by this operation.
contents
- an input streamfileName
- the file name associated to the contents, or null
null
IOException
- if an error occurs while reading the contentsIContentType findContentTypeFor(String fileName)
null
is returned.fileName
- the name of the filenull
IContentType[] findContentTypesFor(InputStream contents, String fileName) throws IOException
Returns an empty array if no associated content types are found.
If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.
Any IOExceptions that may occur while reading the given input stream will flow to the caller. The input stream will not be closed by this operation.
contents
- an input streamfileName
- the file name associated to the contents, or null
IOException
- if an error occurs while reading the contentsIContentType[] findContentTypesFor(String fileName)
Returns an empty array if there are no content types associated.
fileName
- the name of the fileIContentDescription getDescriptionFor(InputStream contents, String fileName, QualifiedName[] options) throws IOException
Any IOExceptions that may occur while reading the given input stream will flow to the caller. The input stream will not be closed by this operation.
If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.
contents
- the contents to be interpretedfileName
- the file name associated to the contents, or null
options
- an array of keys for all properties that should be
described, or IContentDescription.ALL
, for all of themnull
IOException
- if an error occurs while reading the contentsIContentDescription
IContentDescription getDescriptionFor(Reader contents, String fileName, QualifiedName[] options) throws IOException
Any IOExceptions that may occur while reading the given input stream will flow to the caller. The reader will not be closed by this operation.
If a file name is not provided, the entire content type registry will be queried. For performance reasons, it is highly recommended to provide a file name if available.
contents
- the contents to be interpretedfileName
- the file name associated to the contents, or null
options
- an array of keys for all properties that should be
described, or IContentDescription.ALL
, for all of themnull
IOException
- if an error occurs while reading the contentsIContentDescription
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.