Interface Plugin


  • public interface Plugin
    Implement this interface to create a plugin for WhiteRabbit. Register your plugin by adding file META-INF/services/org.itsallcode.whiterabbit.api.Plugin containing the full qualified class name to the jar. Available features:
    • Method Detail

      • init

        void init​(PluginConfiguration config)
        Called once when loading the plugin.
        Parameters:
        config - the configuration of the plugin.
      • supports

        boolean supports​(java.lang.Class<? extends PluginFeature> featureType)
        Check if this plugin supports the given feature.
        Parameters:
        featureType - the feature type.
        Returns:
        true if this plugin supports the given feature, else false.
      • getFeature

        <T extends PluginFeature> T getFeature​(java.lang.Class<T> featureType)
        Get an instance of the given feature type.
        Type Parameters:
        T - the type of the feature.
        Parameters:
        featureType - the feature type.
        Returns:
        the instance of the given feature. May return null or throw an exception if the feature is not supported.
      • close

        void close()
        Called before closing the plugin. The plugin should cleanup any resources in this method.