org.objectweb.fractal.julia.loader
Class DynamicLoader
java.lang.Object
org.objectweb.fractal.julia.loader.BasicLoader
org.objectweb.fractal.julia.loader.DynamicLoader
- All Implemented Interfaces:
- Loader
- public class DynamicLoader
- extends BasicLoader
Provides an implementation of the Loader
interface that can
generate classes on the fly.
Requirements
- the Java platform must provide the Java reflection API and the
ClassLoader class.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DynamicLoader
public DynamicLoader()
loadClass
public Class loadClass(String name)
throws ClassNotFoundException
- Description copied from interface:
Loader
- Loads the class whose name is given.
- Specified by:
loadClass
in interface Loader
- Overrides:
loadClass
in class BasicLoader
- Throws:
ClassNotFoundException
generateClass
protected Class generateClass(String name,
Tree classDescriptor)
throws ClassNotFoundException
- Description copied from class:
BasicLoader
- Generates the class whose descriptor is given, with the given name. The
generated class must implement the
Generated
interface,
and its getFcGeneratorParameters
method must return classDescriptor.toString(). The default
implementation of this method throws an exception.
- Overrides:
generateClass
in class BasicLoader
- Parameters:
name
- the name of the class to be generated.classDescriptor
- the descriptor of the class to be generated. This
descriptor must be of the form "(objectDescriptor arg1 ...
argN)" (see loadClass
).
- Returns:
- a class named name and whose content is described by the
given class descriptor.
- Throws:
ClassNotFoundException
- if a problem occurs during the generation
of the class.