net.sourceforge.groboutils.util.classes.v1.jdk0
Class ArrayClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended bynet.sourceforge.groboutils.util.classes.v1.jdk0.ArrayClassLoader

public class ArrayClassLoader
extends java.lang.ClassLoader

Load classes by byte Arrays. JDK 1.0+ compatible.

Since:
November 17, 2000 (GroboUtils Alpha 0.9.0)
Version:
$Date: 2003/02/10 22:52:36 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
ArrayClassLoader()
          Default constructor
 
Method Summary
 void addClass(java.lang.String name, byte[] bytecode)
          Add a new class to the internal list.
protected  byte[] getBytecode(java.lang.String className)
          Retrieves the internal bytecode for the given class.
 java.lang.Class loadClass(java.lang.String name, boolean resolve)
           
 void setBytecodeSource(BytecodeSource bs)
          Sets the reference to the original bytecode loader.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, 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

ArrayClassLoader

public ArrayClassLoader()
Default constructor

Method Detail

setBytecodeSource

public void setBytecodeSource(BytecodeSource bs)
Sets the reference to the original bytecode loader. By default, the value is null. If the value is null, then there is the possibility for a link error.


addClass

public void addClass(java.lang.String name,
                     byte[] bytecode)
Add a new class to the internal list.


loadClass

public java.lang.Class loadClass(java.lang.String name,
                                 boolean resolve)
                          throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException - thrown if the given class name could not be found, or if there was a problem loading the bytecode for the class.

getBytecode

protected byte[] getBytecode(java.lang.String className)
Retrieves the internal bytecode for the given class. If not known, then will attempt to pass it to the bytecode source.

Parameters:
className - a non-null class name.


Copyright © 2001-2003 by The GroboUtils Project