Documentation of 'org.jgap.util.PluginDiscoverer' Java class
PluginDiscoverer
org.jgap.util

Class PluginDiscoverer



  • public class PluginDiscoverer
    extends java.lang.Object
    This class will (slightly inefficiently) look for all classes that implement a particular interface. It is useful for plugins. This is done by looking through the contents of all jar files in the classpath, as well as performing a recursive search for *.class files in the classpath directories This particular class may not work in restrictive ClassLoader environments such as Applets or WebStart. (It may...but unlikely and untested.)
    Since:
    2.3
    • Constructor Summary

      Constructors 
      Constructor and Description
      PluginDiscoverer()
      Reads the list of jars and classpath folders into instance variables for later (cached) access.
      PluginDiscoverer(java.lang.String a_jarFile)
      Prepares the discoverer for a single jar file
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.List findImplementingClasses(java.lang.Class a_intrface)
      Finds all classes implementing the given interface
      java.util.List findImplementingClasses(java.lang.Class a_intrface, java.lang.String a_base, java.lang.String a_path)
      Finds all classes implementing the given interface within a given directory.
      java.util.List findImplementingClasses(java.lang.String a_fullInterfaceName)
      Finds all classes implementing the given interface
      static void main(java.lang.String[] args)
      For testing purpose
      • Methods inherited from class java.lang.Object

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

      • PluginDiscoverer

        public PluginDiscoverer()
        Reads the list of jars and classpath folders into instance variables for later (cached) access.
        Since:
        2.3
      • PluginDiscoverer

        public PluginDiscoverer(java.lang.String a_jarFile)
        Prepares the discoverer for a single jar file
        Parameters:
        a_jarFile - String
        Since:
        3.2
    • Method Detail

      • findImplementingClasses

        public java.util.List findImplementingClasses(java.lang.String a_fullInterfaceName)
                                               throws java.lang.ClassNotFoundException
        Finds all classes implementing the given interface
        Parameters:
        a_fullInterfaceName - name of the interface (inclusive package name) to find implementing classes (not abstract) for
        Returns:
        list of class names that implement the given interface
        Throws:
        java.lang.ClassNotFoundException
        Since:
        2.4
      • findImplementingClasses

        public java.util.List findImplementingClasses(java.lang.Class a_intrface)
        Finds all classes implementing the given interface
        Parameters:
        a_intrface - the interface to check against
        Returns:
        list of class names that implement the given interface
        Since:
        2.3
      • findImplementingClasses

        public java.util.List findImplementingClasses(java.lang.Class a_intrface,
                                                      java.lang.String a_base,
                                                      java.lang.String a_path)
        Finds all classes implementing the given interface within a given directory.
        Parameters:
        a_intrface - Class
        a_base - String
        a_path - String
        Returns:
        List
      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        For testing purpose
        Parameters:
        args - not used
        Throws:
        java.lang.Exception - in case of any problem
        Since:
        2.3

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.