Package org.plumelib.reflection
Class ReflectionPlume.PromiscuousLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- org.plumelib.reflection.ReflectionPlume.PromiscuousLoader
-
- Enclosing class:
- ReflectionPlume
private static class ReflectionPlume.PromiscuousLoader extends java.lang.ClassLoaderThis static nested class has no purpose but to define defineClassFromFile. ClassLoader.defineClass is protected, so I subclass ClassLoader in order to call defineClass.
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePromiscuousLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>defineClassFromFile(@BinaryName java.lang.String className, java.lang.String pathname)Converts the bytes in a file into an instance of class Class, and also resolves (links) the class.-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Method Detail
-
defineClassFromFile
public java.lang.Class<?> defineClassFromFile(@BinaryName java.lang.String className, java.lang.String pathname) throws java.io.FileNotFoundException, java.io.IOExceptionConverts the bytes in a file into an instance of class Class, and also resolves (links) the class. Delegates the real work to defineClass.- Parameters:
className- the expected binary name of the class to define, or null if not knownpathname- the file from which to load the class- Returns:
- the
Classobject that was created - Throws:
java.io.FileNotFoundException- if the file does not existjava.io.IOException- if there is trouble reading the file- See Also:
ClassLoader.defineClass(String,byte[],int,int)
-
-