org.sonar.java.bytecode.loader
Class SquidClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.sonar.java.bytecode.loader.SquidClassLoader
All Implemented Interfaces:
Closeable

public class SquidClassLoader
extends ClassLoader
implements Closeable

Class loader, which is able to load classes from a list of JAR files and directories.


Constructor Summary
SquidClassLoader(Collection<File> files)
           
 
Method Summary
 void close()
          Closes this class loader, so that it can no longer be used to load new classes or resources.
protected  Class<?> findClass(String name)
           
 URL findResource(String name)
           
protected  Enumeration<URL> findResources(String name)
           
 
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
 

Constructor Detail

SquidClassLoader

public SquidClassLoader(Collection<File> files)
                 throws IOException
Throws:
IOException
Method Detail

findClass

protected Class<?> findClass(String name)
                      throws ClassNotFoundException
Overrides:
findClass in class ClassLoader
Throws:
ClassNotFoundException

findResource

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

findResources

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

close

public void close()
Closes this class loader, so that it can no longer be used to load new classes or resources. Any classes or resources that are already loaded, are still accessible. If class loader is already closed, then invoking this method has no effect.

Specified by:
close in interface Closeable


Copyright © 2009-2012 SonarSource. All Rights Reserved.