classUtils.pack.util
Interface ClassFinderInterface

All Known Subinterfaces:
DynamicClassFinderInterface
All Known Implementing Classes:
ClassFinder

public interface ClassFinderInterface

This interface defines services for publicly load class bytecode. The JDK12ClassFileFinder class implements this interface emulating the Java 2 system class loader behaviour.

Version:
1.0
Author:
Cristiano Sadun

Method Summary
 java.io.File findClassFile(java.lang.String className)
          This method finds the class file - in a way depending on the particular implementation
 byte[] getClassBytes(java.lang.String className)
          Returns a byte array with the bytecode for the class
 java.lang.String getSupportedLoadingScheme()
          Returns the supported loading scheme
 java.io.InputStream openClass(java.lang.String className)
          Open class data.
 

Method Detail

getSupportedLoadingScheme

java.lang.String getSupportedLoadingScheme()
Returns the supported loading scheme

Returns:
a description string

openClass

java.io.InputStream openClass(java.lang.String className)
                              throws java.io.IOException,
                                     java.lang.ClassNotFoundException
Open class data. The input stream reads exactly and only the class byte data.

Parameters:
className - the name of the class to find
Throws:
java.lang.ClassNotFoundException - if the class is not found
java.io.IOException - if an I/O Exception occurs

getClassBytes

byte[] getClassBytes(java.lang.String className)
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Returns a byte array with the bytecode for the class

Parameters:
className - the name of the class to find
Returns:
byte[] the bytecode for the class
Throws:
java.io.IOException - if a problem arises while loading the bytecode
java.lang.ClassNotFoundException - if the class definition cannot be found

findClassFile

java.io.File findClassFile(java.lang.String className)
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
This method finds the class file - in a way depending on the particular implementation

Parameters:
className - the name of the class to find
Returns:
the File object for the class file; this can be a .class file, or a JAR file containing the class or other
Throws:
java.lang.ClassNotFoundException - if the class is not found
java.io.IOException - if an I/O Exception occurs