Package org.plumelib.reflection
Class ReflectionPlume.PromiscuousLoader
java.lang.Object
java.lang.ClassLoader
org.plumelib.reflection.ReflectionPlume.PromiscuousLoader
- Enclosing class:
- ReflectionPlume
This 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 -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
defineClassFromFile
(@BinaryName String className, 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
-
Constructor Details
-
PromiscuousLoader
private PromiscuousLoader()
-
-
Method Details
-
defineClassFromFile
public Class<?> defineClassFromFile(@BinaryName String className, String pathname) throws FileNotFoundException, IOException Converts 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
Class
object that was created - Throws:
FileNotFoundException
- if the file does not existIOException
- if there is trouble reading the file- See Also:
-