Class ConfigurableClassLoader.ClassSource

java.lang.Object
eu.bandm.tools.util.classes.ConfigurableClassLoader.ClassSource
Direct Known Subclasses:
ConfigurableClassLoader.ClassDirectory, ConfigurableClassLoader.JarArchive
Enclosing class:
ConfigurableClassLoader

public abstract class ConfigurableClassLoader.ClassSource extends Object
Abstract location from which a class can be loaded.
  • Constructor Details

    • ClassSource

      public ClassSource()
  • Method Details

    • openClass

      protected abstract InputStream openClass(String name) throws IOException
      Return an input stream which contains all data of the class with the given name.
      Parameters:
      name - the binary class name to be loaded by this class loader
      Throws:
      IOException - if no file corresponding to the class name can be found.
    • getClassData

      @Opt protected @eu.bandm.tools.annotations.Opt byte[] getClassData(String name) throws IOException
      Returns a byte array with all data of the class with the given name.
      Parameters:
      name - the class name to be loaed by this class loader
      Returns:
      null if no file corresponding to the class name can be found.
      Throws:
      IOException
    • findClass

      public Class<?> findClass(String name) throws ClassNotFoundException
      Returns the class object, if the class with the given name is found at this position.
      Parameters:
      name - the binary class name of the class
      Returns:
      the class as created by ClassLoader.defineClass(byte[], int, int)
      Throws:
      ClassNotFoundException - iff no class with the given name is found.