Package org.omegat.filters2.master
Class PluginUtils
java.lang.Object
org.omegat.filters2.master.PluginUtils
Static utilities for OmegaT filter plugins.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ClassLoaderRetrieves theClassLoaderassociated with the specifiedPluginUtils.PluginType.Retrieves a list of filter classes.static URLGet the list of loaded plugins.static Collection<PluginInformation>Get the list of plugin information.Retrieves a list of spellchecker classes available in the system.Retrieves a list of tokenizer classes available in the system.static Class<?>Retrieves the tokenizer class for a given language.static voidLoad plugin for test.static voidloadPlugins(Map<String, String> params) Loads plugins for the application.static void
-
Field Details
-
PLUGINS_LIST_FILE
- See Also:
-
-
Method Details
-
loadPlugins
Loads plugins for the application. This method initializes plugin locations, class loaders, and processes plugin manifests to load plugins based on the provided parameters.- Parameters:
params- a map containing configuration parameters that may specify additional settings for plugin loading, including development mode manifests or other configurations.
-
loadPluginFromProperties
@VisibleForTesting public static void loadPluginFromProperties(Properties props) throws ClassNotFoundException Load plugin for test.WARN: don't use it for general purpose.
- Parameters:
props- properties that have "plugin=(classes...)"- Throws:
ClassNotFoundException- when specified plugin is not found.
-
getFilterClasses
Retrieves a list of filter classes.- Returns:
- a list of filter class objects
-
getTokenizerClasses
Retrieves a list of tokenizer classes available in the system.- Returns:
- a list of classes representing tokenizer implementations.
-
getSpellCheckClasses
Retrieves a list of spellchecker classes available in the system.- Returns:
- a list of classes representing spellchecker implementations.
-
getTokenizerClassForLanguage
Retrieves the tokenizer class for a given language.- Parameters:
lang- the language for which to retrieve the tokenizer class- Returns:
- the tokenizer class for the specified language, or the default tokenizer class if no specific tokenizer is found
-
getMarkerClasses
-
getMachineTranslationClasses
-
getGlossaryClasses
-
getAutoCompleterViewsClasses
-
getClassLoader
Retrieves theClassLoaderassociated with the specifiedPluginUtils.PluginType. If the provided plugin type isUNKNOWN, the method returnsnull.- Parameters:
type- thePluginUtils.PluginTypefor which the class loader is needed.- Returns:
- the
ClassLoaderassociated with the specified plugin type, ornullif the type isUNKNOWN.
-
unloadPlugins
public static void unloadPlugins() -
getPluginInformations
Get the list of plugin information.- Returns:
- the list of plugin information.
-
getJarFileUrlFromResourceUrl
Get the list of loaded plugins.- Parameters:
url- the resource URL- Returns:
- the jar file URL from the resource URL
- Throws:
IOException- if an I/O error occurs
-