ILanguageIdentifierService¶
-
public interface
ILanguageIdentifierService
¶ Interface for identifying the language of a resource.
Methods¶
available¶
-
boolean
available
(ILanguageImpl impl)¶ Returns if language identification is available for given implementation.
Parameters: - impl – Language implementation to check.
Returns: True if identification is available, false if not.
identify¶
-
boolean
identify
(FileObject resource, ILanguageImpl language)¶ Checks if given resource is of given language.
Parameters: - resource – Resource to check.
- language – Language to check against.
Returns: True if resource is of given language, false otherwise.
identify¶
-
ILanguageImpl
identify
(FileObject resource)¶ Attempts to identify the active language of given resource.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified language, or null if language could not be identified.
identify¶
-
ILanguageImpl
identify
(FileObject resource, IProject project)¶ Attempts to identify the active language of given resource.
Parameters: - resource – Resource to identify.
- project – The projectto which the resource belongs; or
null
if not known.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified language, or null if language could not be identified.
identify¶
-
ILanguageImpl
identify
(FileObject resource, Iterable<? extends ILanguageImpl> languages)¶ Attempts to identify the language of given resource, among given list of languages.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to multiple languages.
Returns: Identified language, or null if language could not be identified.
identifyToResource¶
-
IdentifiedResource
identifyToResource
(FileObject resource)¶ Attempts to identify the active language of given resource, and return an identified resource.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified resource, or null if language could not be identified.
identifyToResource¶
-
IdentifiedResource
identifyToResource
(FileObject resource, IProject project)¶ Attempts to identify the active language of given resource, and return an identified resource.
Parameters: - resource – Resource to identify.
- project – The project to which the resource belongs; or
null
if not known.
Throws: - IllegalStateException – When a resource can be identified to languages with different names.
Returns: Identified resource, or null if language could not be identified.
identifyToResource¶
-
IdentifiedResource
identifyToResource
(FileObject resource, Iterable<? extends ILanguageImpl> languages)¶ Attempts to identify the language of given resource, among given list of languages, and return an identified resource.
Parameters: - resource – Resource to identify.
Throws: - IllegalStateException – When a resource can be identified to multiple languages.
Returns: Identified resource, or null if language could not be identified.