| java.lang.Object org.netbeans.spi.lexer.LanguageProvider
All known Subclasses: org.netbeans.lib.lexer.test.TestLanguageProvider, org.netbeans.modules.lexer.nbbridge.MimeLookupLanguageProvider, org.netbeans.lib.lexer.test.simple.SimpleLanguageProvider, org.netbeans.lib.lexer.LanguageManager,
LanguageProvider | abstract public class LanguageProvider (Code) | | The Language provider. This class is a hook into the
lexer framework allowing modules to provide a language resolution service.
Whenever a Language is not explicitly known the
framework tries to determine it by asking LanguageProvider s registered
in the Lookup.getDefault() .
Language s might be needed for a mime type or mime path
of a Document used as an input source or they might be needed for
some tokens that contain text in an another (embedded) language. In both cases
a Language can either be explicitely provided by setting
the document's property or implementing the LanguageHierarchy.embedded()
method respectively or the framework will use LanguageProvider s to
create the appropriate Language .
author: Vita Stejskal |
Field Summary | |
final public static String | PROP_EMBEDDED_LANGUAGE The name of the property, which should be fired when the embedded language to
Language mapping changes. | final public static String | PROP_LANGUAGE The name of the property, which should be fired when the mime paths to
Language mapping changes. |
Constructor Summary | |
protected | LanguageProvider() The default constructor for subclasses. |
PROP_EMBEDDED_LANGUAGE | final public static String PROP_EMBEDDED_LANGUAGE(Code) | | The name of the property, which should be fired when the embedded language to
Language mapping changes.
|
PROP_LANGUAGE | final public static String PROP_LANGUAGE(Code) | | The name of the property, which should be fired when the mime paths to
Language mapping changes.
|
LanguageProvider | protected LanguageProvider()(Code) | | The default constructor for subclasses.
|
addPropertyChangeListener | final public void addPropertyChangeListener(PropertyChangeListener l)(Code) | | Add a listener for change notifications.
Parameters: l - The listener to add. |
findLanguage | abstract public Language> findLanguage(String mimeType)(Code) | | Finds Language for a given mime type.
The lexer framework uses this method to find a Language
for Document s that are used as an input source. If the document
itself does not specify its Language the framework
will consult registered LanguageProvider s to find out the
Language appropriate for the document's mime type.
Parameters: mimeType - The mime type of a Language to find. The Language registered for the givenmime type or null if no such Language exists. |
findLanguageEmbedding | abstract public LanguageEmbedding> findLanguageEmbedding(Token> token, LanguagePath languagePath, InputAttributes inputAttributes)(Code) | | Finds LanguageEmbedding that will define what language is
embedded in a given token.
If a Token contains text in a different language that could
further be used for lexing of this Token the framework will try
to find out the Language of that language by asking
the Token 's own Language first and then
by consulting registered LanguageProvider s. The LanguageProvider s
are expected to return a LanguageEmbedding for tokens they
care about and null for the rest. The first non-null
LanguageEmbedding found will be used.
LanguageEmbedding instances returned from this method
must not reference any of the attributes passed in and especially not
the token instance.
Parameters: token - The Token to get the Language for. Parameters: languagePath - The LanguagePath of the token, whichembedded language should be returned. Parameters: inputAttributes - The attributes that could affect the creation ofthe embedded Language . It may be null if there are no extra attributes. The LanguageEmbedding for the given Token or null if the token can't embedd any languageor the token is unknown to this LanguageProvider .
|
firePropertyChange | final protected void firePropertyChange(String propertyName)(Code) | | |
removePropertyChangeListener | final public void removePropertyChangeListener(PropertyChangeListener l)(Code) | | Remove a listener.
Parameters: l - The listener to remove. |
|
|