Class BasePluginType

    • Constructor Detail

      • BasePluginType

        public BasePluginType​(Class<? extends Annotation> pluginClass)
      • BasePluginType

        public BasePluginType​(Class<? extends Annotation> pluginClass,
                              String id,
                              String name)
        Parameters:
        id - The plugin type ID
        name - the name of the plugin
    • Method Detail

      • getXmlPluginFile

        protected String getXmlPluginFile()
        This method return parameter for registerNatives() method
        Returns:
        XML plugin file
      • getAlternativePluginFile

        protected String getAlternativePluginFile()
        This method return parameter for registerNatives() method
        Returns:
        Alternative XML plugin file
      • getMainTag

        protected String getMainTag()
        This method return parameter for registerPlugins() method
        Returns:
        Main XML tag
      • getSubTag

        protected String getSubTag()
        This method return parameter for registerPlugins() method
        Returns:
        Subordinate XML tag
      • getPath

        protected String getPath()
        This method return parameter for registerPlugins() method
        Returns:
        Path
      • isReturn

        protected boolean isReturn()
        This method return parameter for registerNatives() method
        Returns:
        Flag ("return;" or "throw exception")
      • populateFolders

        protected void populateFolders​(String xmlSubfolder)
        this is a utility method for subclasses so they can easily register which folders contain plugins
        Parameters:
        xmlSubfolder - the sub-folder where xml plugin definitions can be found
      • getAdditionalRuntimeObjectTypes

        public Map<Class<?>,​String> getAdditionalRuntimeObjectTypes()
      • addObjectType

        public void addObjectType​(Class<?> clz,
                                  String xmlNodeName)
        Description copied from interface: PluginTypeInterface
        Register an additional class type to be managed by the plugin system.
        Specified by:
        addObjectType in interface PluginTypeInterface
        Parameters:
        clz - category class, usually an interface
        xmlNodeName - xml node to search for a class name
      • getResAsStreamExternal

        protected InputStream getResAsStreamExternal​(String name)
      • setId

        public void setId​(String id)
        Parameters:
        id - the id to set
      • setName

        public void setName​(String name)
        Parameters:
        name - the name to set
      • setPluginFolders

        public void setPluginFolders​(List<PluginFolderInterface> pluginFolders)
        Parameters:
        pluginFolders - the pluginFolders to set
      • getCodedTranslation

        protected static String getCodedTranslation​(String codedString)
      • getTranslation

        protected static String getTranslation​(String string,
                                               String packageName,
                                               String altPackageName,
                                               Class<?> resourceClass)
      • findPluginXmlFiles

        protected List<org.apache.commons.vfs2.FileObject> findPluginXmlFiles​(String folder)
      • findPluginFiles

        protected List<org.apache.commons.vfs2.FileObject> findPluginFiles​(String folder,
                                                                           String regex)
      • registerCustom

        public void registerCustom​(Class<?> clazz,
                                   String cat,
                                   String id,
                                   String name,
                                   String desc,
                                   String image)
                            throws KettlePluginException
        This method allows for custom registration of plugins that are on the main classpath. This was originally created so that test environments could register test plugins programmatically.
        Parameters:
        clazz - the plugin implementation to register
        cat - the category of the plugin
        id - the id for the plugin
        name - the name for the plugin
        desc - the description for the plugin
        image - the image for the plugin
        Throws:
        KettlePluginException
      • getTagOrAttribute

        protected String getTagOrAttribute​(Node pluginNode,
                                           String tag)
      • getAlternativeTranslation

        protected String getAlternativeTranslation​(String input,
                                                   Map<String,​String> localizedMap)
        Parameters:
        input -
        localizedMap -
        Returns:
      • createUrlClassLoader

        protected URLClassLoader createUrlClassLoader​(URL jarFileUrl,
                                                      ClassLoader classLoader)
        Create a new URL class loader with the jar file specified. Also include all the jar files in the lib folder next to that file.
        Parameters:
        jarFileUrl - The jar file to include
        classLoader - the parent class loader to use
        Returns:
        The URL class loader
      • extractName

        protected abstract String extractName​(Annotation annotation)
      • extractDesc

        protected abstract String extractDesc​(Annotation annotation)
      • extractCategory

        protected abstract String extractCategory​(Annotation annotation)
      • extractImageFile

        protected abstract String extractImageFile​(Annotation annotation)
      • extractSeparateClassLoader

        protected abstract boolean extractSeparateClassLoader​(Annotation annotation)
      • extractI18nPackageName

        protected abstract String extractI18nPackageName​(Annotation annotation)
      • extractDocumentationUrl

        protected abstract String extractDocumentationUrl​(Annotation annotation)
      • extractSuggestion

        protected abstract String extractSuggestion​(Annotation annotation)
      • extractCasesUrl

        protected abstract String extractCasesUrl​(Annotation annotation)
      • extractForumUrl

        protected abstract String extractForumUrl​(Annotation annotation)
      • extractClassLoaderGroup

        protected String extractClassLoaderGroup​(Annotation annotation)
      • setTransverseLibDirs

        protected void setTransverseLibDirs​(boolean transverseLibDirs)
        When set to true the PluginFolder objects created by this type will be instructed to search for additional plugins in the lib directory of plugin folders.
        Parameters:
        transverseLibDirs -
      • addExtraClasses

        protected abstract void addExtraClasses​(Map<Class<?>,​String> classMap,
                                                Class<?> clazz,
                                                Annotation annotation)
        Extract extra classes information from a plugin annotation.
        Parameters:
        classMap -
        clazz -
        annotation -