org.h2.util
Class SourceCompiler

java.lang.Object
  extended by org.h2.util.SourceCompiler

public class SourceCompiler
extends java.lang.Object

This class allows to convert source code to a class. It uses one class loader per class.


Constructor Summary
SourceCompiler()
           
 
Method Summary
 java.lang.reflect.Method getMethod(java.lang.String className)
          Get the first public static method of the given class.
 void setSource(java.lang.String className, java.lang.String source)
          Set the source code for the specified class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceCompiler

public SourceCompiler()
Method Detail

setSource

public void setSource(java.lang.String className,
                      java.lang.String source)
Set the source code for the specified class. This will reset all compiled classes.

Parameters:
className - the class name
source - the source code

getMethod

public java.lang.reflect.Method getMethod(java.lang.String className)
                                   throws java.lang.ClassNotFoundException
Get the first public static method of the given class.

Parameters:
className - the class name
Returns:
the method name
Throws:
java.lang.ClassNotFoundException