Class PluginLoaderRegistry


  • public final class PluginLoaderRegistry
    extends java.lang.Object
    • Method Summary

      Modifier and Type Method Description
      PluginLoader getLoader​(java.io.File file)
      Gets a plugin loader by the specified file.
      PluginLoader getLoader​(java.lang.String extension)
      Gets a plugin loader by the specified extension.
      java.util.Collection<PluginLoader> getRegisteredLoaders()
      Gets a collection of all currently registered plugin loaders.
      void registerLoader​(java.lang.String extension, PluginLoader loader)
      Registers a plugin loader for a given extension.
      PluginLoader unregisterLoader​(java.lang.String extension)
      Unregisters a plugin loader from the system.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PluginLoaderRegistry

        public PluginLoaderRegistry()
    • Method Detail

      • getRegisteredLoaders

        public java.util.Collection<PluginLoader> getRegisteredLoaders()
        Gets a collection of all currently registered plugin loaders.
        Returns:
        Plugin loader list.
      • registerLoader

        public void registerLoader​(java.lang.String extension,
                                   PluginLoader loader)
        Registers a plugin loader for a given extension.
        Parameters:
        extension - extension to map the loader to.
        loader - loader to map to the extension.
      • unregisterLoader

        public PluginLoader unregisterLoader​(java.lang.String extension)
        Unregisters a plugin loader from the system.
        Parameters:
        extension - extension to unmap a loader from.
        Returns:
        removed PluginLoader instance.
      • getLoader

        public PluginLoader getLoader​(java.io.File file)
                               throws java.lang.IllegalArgumentException
        Gets a plugin loader by the specified file.
        Parameters:
        file - File to get an associated plugin loader for.
        Returns:
        PluginLoader instance responsible for the specified file.
        Throws:
        java.lang.IllegalArgumentException - if the file extension is not recognized.
      • getLoader

        public PluginLoader getLoader​(java.lang.String extension)
                               throws java.lang.IllegalArgumentException
        Gets a plugin loader by the specified extension.
        Parameters:
        extension - Extension to get an associated plugin loader for.
        Returns:
        PluginLoader instance responsible for the specified extension.
        Throws:
        java.lang.IllegalArgumentException - if the file extension is not recognized.