de.smartics.properties.utils
Class ProjectClassLoader

Package class diagram package ProjectClassLoader
java.lang.Object
  extended by java.lang.ClassLoader
      extended by de.smartics.properties.utils.AbstractProjectClassLoader
          extended by de.smartics.properties.utils.ProjectClassLoader

public final class ProjectClassLoader
     
     
extends AbstractProjectClassLoader

A class loader that serves classes from the given directories.


Method Summary
static ProjectClassLoader create(ClassLoader parent, List<File> rootDirectories)
          Default factory method.
static ProjectClassLoader create(List<File> rootDirectories)
          Convenience factory method using the Thread.currentThread().getContextClassLoader().
static ProjectClassLoader createFromNames(ClassLoader parent, Collection<String> rootDirectoryNames)
          Convenience factory method to specify the directories as Strings.
static ProjectClassLoader createFromNames(Collection<String> rootDirectoryNames)
          Convenience factory method to specify the directories as Strings and using the Thread.currentThread().getContextClassLoader().
protected  Class<?> findClass(String name)
          
protected  URL findResource(String name)
           
protected  Enumeration<URL> findResources(String name)
           
 
Methods inherited from class de.smartics.properties.utils.AbstractProjectClassLoader
ensurePackageProvided, loadClassFile, loadClassFromLibrary, loadResourceFromLibrary
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ProjectClassLoader create(List<File> rootDirectories)
Convenience factory method using the Thread.currentThread().getContextClassLoader().

Parameters:
rootDirectories - the list of root directories to search for classes.
Returns:
the requested instance.

createFromNames

public static ProjectClassLoader createFromNames(Collection<String> rootDirectoryNames)
Convenience factory method to specify the directories as Strings and using the Thread.currentThread().getContextClassLoader().

Parameters:
rootDirectoryNames - the list of root directory names to search for classes.
Returns:
the requested instance.

createFromNames

public static ProjectClassLoader createFromNames(ClassLoader parent,
                                                 Collection<String> rootDirectoryNames)
Convenience factory method to specify the directories as Strings.

Parameters:
parent - the parent class loader.
rootDirectoryNames - the list of root directory names to search for classes.
Returns:
the requested instance.

create

public static ProjectClassLoader create(ClassLoader parent,
                                        List<File> rootDirectories)
Default factory method.

Parameters:
parent - the parent class loader.
rootDirectories - the list of root directories to search for classes.
Returns:
the requested instance.

findResource

protected URL findResource(String name)
Overrides:
findResource in class ClassLoader

findResources

protected Enumeration<URL> findResources(String name)
Overrides:
findResources in class ClassLoader

findClass

protected Class<?> findClass(String name)
                      throws ClassNotFoundException

Overrides:
findClass in class ClassLoader
Throws:
ClassNotFoundException


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.