org.codehaus.groovy.runtime
Class ReflectorLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.codehaus.groovy.runtime.ReflectorLoader

public class ReflectorLoader
extends ClassLoader

Reflector creation helper. This class is used to define the Refloctor classes. For each ClassLoader such a Loader will be created by the MetaClass. The only special about this loader is, that it knows the class Reflector, which is the base class of all runtime created Reflectors.

Version:
$Revision: 4542 $
Author:
Jochen Theodorou

Constructor Summary
ReflectorLoader(ClassLoader parent)
          creates a RelfectorLoader.
 
Method Summary
 Class defineClass(String name, byte[] bytecode, ProtectionDomain domain)
          helper method to define Reflector classes
protected  Class findClass(String name)
          returns the Reflector class.
 Class getLoadedClass(String name)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, 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

ReflectorLoader

public ReflectorLoader(ClassLoader parent)
creates a RelfectorLoader.

Parameters:
parent - the parent loader. This should never be null!
Method Detail

findClass

protected Class findClass(String name)
                   throws ClassNotFoundException
returns the Reflector class.

Overrides:
findClass in class ClassLoader
Returns:
the Reflector class if the name matches
Throws:
ClassNotFoundException - if the name is not matching Reflector
See Also:
Reflector

defineClass

public Class defineClass(String name,
                         byte[] bytecode,
                         ProtectionDomain domain)
helper method to define Reflector classes

Parameters:
name - of the Reflector
bytecode - the bytecode
domain - the protection domain
Returns:
the generated class

getLoadedClass

public Class getLoadedClass(String name)


Copyright © 2003-2008 The Codehaus. All Rights Reserved.