Class ReflectionPlume.PromiscuousLoader

  • Enclosing class:
    ReflectionPlume

    private static class ReflectionPlume.PromiscuousLoader
    extends java.lang.ClassLoader
    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 
      Modifier Constructor Description
      private PromiscuousLoader()  
    • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PromiscuousLoader

        private PromiscuousLoader()
    • Method Detail

      • defineClassFromFile

        public java.lang.Class<?> defineClassFromFile​(@BinaryName java.lang.String className,
                                                      java.lang.String pathname)
                                               throws java.io.FileNotFoundException,
                                                      java.io.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 known
        pathname - the file from which to load the class
        Returns:
        the Class object that was created
        Throws:
        java.io.FileNotFoundException - if the file does not exist
        java.io.IOException - if there is trouble reading the file
        See Also:
        ClassLoader.defineClass(String,byte[],int,int)