public abstract class Language extends UserDataHolderBase
LanguageFileType
via com.intellij.fileType
extension point.
There should be exactly one instance of each Language.
It is usually created when creating LanguageFileType
and can be retrieved later with findInstance(Class)
.
For the list of standard languages, see StdLanguages
.
The language coming from file type can be changed by LanguageSubstitutor
.
Modifier | Constructor and Description |
---|---|
protected |
Language(Language baseLanguage,
java.lang.String ID,
java.lang.String... mimeTypes) |
protected |
Language(java.lang.String ID) |
protected |
Language(java.lang.String ID,
boolean register)
Fake language identifier without registering
|
protected |
Language(java.lang.String ID,
java.lang.String... mimeTypes) |
Modifier and Type | Method and Description |
---|---|
static <T extends Language> |
findInstance(java.lang.Class<T> klass) |
static java.util.Collection<Language> |
findInstancesByMimeType(java.lang.String mimeType) |
static Language |
findLanguageByID(java.lang.String id) |
LanguageFileType |
findMyFileType(FileType[] types) |
LanguageFileType |
getAssociatedFileType() |
Language |
getBaseLanguage() |
java.util.List<Language> |
getDialects() |
java.lang.String |
getDisplayName() |
java.lang.String |
getID()
Returns a user-readable name of the language.
|
java.lang.String [] |
getMimeTypes()
Returns the list of MIME types corresponding to the language.
|
static java.util.Collection<Language> |
getRegisteredLanguages() |
boolean |
is(Language another) |
boolean |
isCaseSensitive() |
boolean |
isKindOf(Language another) |
boolean |
isKindOf(java.lang.String anotherLanguageId) |
java.lang.String |
toString() |
void |
unregisterDialect(Language language) |
static void |
unregisterLanguage(Language language) |
static void |
unregisterLanguages(java.lang.ClassLoader classLoader) |
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
public static final Language ANY
protected Language(java.lang.String ID)
protected Language(java.lang.String ID, java.lang.String... mimeTypes)
protected Language(Language baseLanguage, java.lang.String ID, java.lang.String... mimeTypes)
protected Language(java.lang.String ID, boolean register)
public static java.util.Collection<Language> getRegisteredLanguages()
public static void unregisterLanguages(java.lang.ClassLoader classLoader)
public static void unregisterLanguage(Language language)
public void unregisterDialect(Language language)
public static <T extends Language> T findInstance(java.lang.Class<T> klass)
klass
- java.lang.Class
of the particular language. Serves key purpose.klass
language registered if any.public static java.util.Collection<Language> findInstancesByMimeType(java.lang.String mimeType)
mimeType
- of the particular language.mimeType
.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String [] getMimeTypes()
public java.lang.String getID()
public LanguageFileType getAssociatedFileType()
public LanguageFileType findMyFileType(FileType[] types)
public Language getBaseLanguage()
public java.lang.String getDisplayName()
public final boolean is(Language another)
public boolean isCaseSensitive()
public final boolean isKindOf(Language another)
public final boolean isKindOf(java.lang.String anotherLanguageId)
public java.util.List<Language> getDialects()
public static Language findLanguageByID(java.lang.String id)