org.sourceforge.jemm.weaver.io
Class ClassPathLoader

java.lang.Object
  extended by org.sourceforge.jemm.weaver.io.ClassPathLoader
All Implemented Interfaces:
ClassLoader

public class ClassPathLoader
extends java.lang.Object
implements ClassLoader

Loads a Class from the ClassPath.

Author:
Paul Keeble

Constructor Summary
ClassPathLoader()
          Creates a ClassPathLoader using the default ClassLoader as its underlying loader.
ClassPathLoader(java.lang.ClassLoader loader)
          Create a ClassPathLoader with the given underlying class loader
 
Method Summary
 byte[] readClass(java.lang.String className)
          Finds a class in the Readers space and loads all the bytes of the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPathLoader

public ClassPathLoader()
Creates a ClassPathLoader using the default ClassLoader as its underlying loader.


ClassPathLoader

public ClassPathLoader(java.lang.ClassLoader loader)
Create a ClassPathLoader with the given underlying class loader

Parameters:
loader - A ClassLoader instance to use.
Method Detail

readClass

public byte[] readClass(java.lang.String className)
                 throws ClassNotFoundException,
                        java.io.IOException
Description copied from interface: ClassLoader
Finds a class in the Readers space and loads all the bytes of the file.

Specified by:
readClass in interface ClassLoader
Parameters:
className - the fully qualified file name using /'s as separators. eg com/package/Name.class
Returns:
The bytes representing the contents of the found file.
Throws:
ClassNotFoundException - If the given class can not be found.
java.io.IOException - On IO Error whilst reading class.


Copyright © 2009. All Rights Reserved.