com.usefullittlethings.saw.util
Class SawClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--com.usefullittlethings.saw.util.SawClassLoader

public class SawClassLoader
extends java.lang.ClassLoader

Utility class extending ClassLoader to provide application-specific class loading features, such as plug-in loading.

See Also:
ClassLoader

Method Summary
 void addListener(java.awt.event.ActionListener l)
           
 java.lang.Class[] getClassesFromJar(java.lang.String name, java.lang.String ifc)
           
static SawClassLoader getInstance()
           
 ActionPluginIfc[] loadActions(java.io.File pluginFolder, java.lang.Class classType)
           
 java.lang.Class loadClassFromJar(java.lang.String name, java.lang.String className)
           
 FilterPluginIfc[] loadFilters(java.io.File pluginFolder, java.lang.Class classType)
           
 SearchControllerIfc loadSearchController(java.lang.String className)
          Loads a class implementing the SearchControllerIfc interface that is referenced by the specified className.
 SearchControllerIfc[] loadSearchControllers(java.io.File pluginFolder)
           
 SearchUIIfc loadSearchUI(java.lang.String className)
          Loads a class implementing the SearchUIIfc interface that is referenced by the specified className.
 void removeListener(java.awt.event.ActionListener l)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SawClassLoader getInstance()

loadSearchController

public SearchControllerIfc loadSearchController(java.lang.String className)
Loads a class implementing the SearchControllerIfc interface that is referenced by the specified className.

Parameters:
className - A fully-qualified class name (i.e.- com.usefullittlethings.saw.apps.file.FileSearchController)
Returns:
An instance of the specified class or null

loadSearchUI

public SearchUIIfc loadSearchUI(java.lang.String className)
Loads a class implementing the SearchUIIfc interface that is referenced by the specified className.

Parameters:
className - A fully-qualified class name (i.e.- com.usefullittlethings.saw.apps.file.FileSearchUI)
Returns:
An instance of the specified class or null

loadSearchControllers

public SearchControllerIfc[] loadSearchControllers(java.io.File pluginFolder)

loadFilters

public FilterPluginIfc[] loadFilters(java.io.File pluginFolder,
                                     java.lang.Class classType)

loadActions

public ActionPluginIfc[] loadActions(java.io.File pluginFolder,
                                     java.lang.Class classType)

getClassesFromJar

public java.lang.Class[] getClassesFromJar(java.lang.String name,
                                           java.lang.String ifc)
                                    throws java.net.MalformedURLException,
                                           java.io.IOException
java.net.MalformedURLException
java.io.IOException

loadClassFromJar

public java.lang.Class loadClassFromJar(java.lang.String name,
                                        java.lang.String className)
                                 throws java.net.MalformedURLException,
                                        java.io.IOException,
                                        java.lang.ClassNotFoundException
java.net.MalformedURLException
java.io.IOException
java.lang.ClassNotFoundException

addListener

public void addListener(java.awt.event.ActionListener l)

removeListener

public void removeListener(java.awt.event.ActionListener l)