org.dellroad.jc
Class JCFinder

java.lang.Object
  extended byorg.dellroad.jc.JCFinder
All Implemented Interfaces:
ClassfileFinder

public class JCFinder
extends Object
implements ClassfileFinder

Gateway into the JC virtual machine for retrieving class files.


Constructor Summary
JCFinder(ClassLoader loader)
          Create a new finder that uses the given class loader to pull in not-before-seen class files as necessary.
 
Method Summary
 byte[] getClassfile(String className)
          Retrieve the class file that is used to define the named class.
 long getClassfileHash(String className)
          Return the hash of the bytes that would be returned by getClassfile() with the same arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCFinder

public JCFinder(ClassLoader loader)
Create a new finder that uses the given class loader to pull in not-before-seen class files as necessary.

Method Detail

getClassfile

public byte[] getClassfile(String className)
                    throws ClassNotFoundException
Description copied from interface: ClassfileFinder
Retrieve the class file that is used to define the named class. This is a capability specific to the JC virtual machine.

Specified by:
getClassfile in interface ClassfileFinder
Parameters:
className - Class name (with slashes, not dots)
Throws:
ClassNotFoundException - if class is not found

getClassfileHash

public long getClassfileHash(String className)
                      throws ClassNotFoundException
Description copied from interface: ClassfileFinder
Return the hash of the bytes that would be returned by getClassfile() with the same arguments. The hash of a class file is defined as the last 16 bytes of the MD5 of the class file.

Specified by:
getClassfileHash in interface ClassfileFinder
Parameters:
className - Class name (with slashes, not dots)
Throws:
ClassNotFoundException - if class is not found