Пример #1
0
        /// <summary>
        /// Loads plug-ins from one or more directories
        /// </summary>
        /// <param name="pluginDirectories"> An array of directories that contains all plug-ins </param>
        /// <exception cref="MaltChainedException"> </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void loadPlugins(java.io.File[] pluginDirectories) throws org.maltparser.core.exception.MaltChainedException
        public virtual void loadPlugins(File[] pluginDirectories)
        {
            directories = new File[pluginDirectories.Length];
            for (int i = 0; i < directories.Length; i++)
            {
                directories[i] = pluginDirectories[i];
            }

            try
            {
                Type self = Type.GetType("org.maltparser.core.plugin.PluginLoader");
                jarLoader = new JarLoader(self.ClassLoader);
            }
            catch (ClassNotFoundException e)
            {
                throw new PluginException("The class 'org.maltparser.core.plugin.PluginLoader' not found. ", e);
            }
            traverseDirectories();
        }
Пример #2
0
 /// <summary>
 /// Creates a PluginLoader
 /// </summary>
 /// <exception cref="PluginException"> </exception>
 private PluginLoader()
 {
     pluginNames = new SortedSet <string>();
     plugins     = new Dictionary <string, Plugin>();
     jarLoader   = null;
 }