com.deltax.util
Interface ClassFileFinder

All Known Subinterfaces:
DynamicClassFileFinder
All Known Implementing Classes:
DynamicJDK12ClassFileFinder, JDK12ClassFileFinder

public interface ClassFileFinder

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 * @param className the name of the class to find * @return byte[] the bytecode for the class * @throws IOException if a problem arises while loading the bytecode * @throws ClassNotFoundException if the class definition cannot be found
 java.lang.String getSupportedLoadingScheme()
          Returns the supported loading scheme
 java.io.InputStream openClass(java.lang.String className)
          Open class data.
 

Method Detail

getSupportedLoadingScheme

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

Returns:
a description string

openClass

public 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

public byte[] getClassBytes(java.lang.String className)
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Returns a byte array with the bytecode for the class * @param className the name of the class to find * @return byte[] the bytecode for the class * @throws IOException if a problem arises while loading the bytecode * @throws ClassNotFoundException if the class definition cannot be found

Throws:
java.io.IOException
java.lang.ClassNotFoundException

findClassFile

public 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