net.janino
Class SimpleCompiler

java.lang.Object
  |
  +--net.janino.EvaluatorBase
        |
        +--net.janino.SimpleCompiler

public class SimpleCompiler
extends EvaluatorBase

A simplified version of Compiler that can compile only a single compilation unit. (A "compilation unit" is the characters stored in a ".java" file.)

Opposed to a normal ".java" file, you can declare multiple public classes here.


Constructor Summary
SimpleCompiler(Scanner scanner, java.lang.ClassLoader classLoader)
          Parse a compilation unit from the given Scanner object and compile it to a set of JavaTM classes.
SimpleCompiler(java.lang.String fileName)
           
SimpleCompiler(java.lang.String fileName, java.io.InputStream is)
           
SimpleCompiler(java.lang.String fileName, java.io.Reader in)
           
 
Method Summary
 java.lang.ClassLoader getClassLoader()
          Returns a java.lang.ClassLoader object through which the previously compiled classes can be accessed.
 
Methods inherited from class net.janino.EvaluatorBase
addClassDeclaration, addClassMethodBlockDeclaration, classesToTypes, classToType, compileAndLoad, compileAndLoad, makeFormalParameters, parseImportDeclarations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCompiler

public SimpleCompiler(java.lang.String fileName,
                      java.io.Reader in)
               throws java.io.IOException,
                      Scanner.ScanException,
                      Parser.ParseException,
                      Java.CompileException,
                      java.lang.ClassNotFoundException

SimpleCompiler

public SimpleCompiler(java.lang.String fileName,
                      java.io.InputStream is)
               throws java.io.IOException,
                      Scanner.ScanException,
                      Parser.ParseException,
                      Java.CompileException,
                      java.lang.ClassNotFoundException

SimpleCompiler

public SimpleCompiler(java.lang.String fileName)
               throws java.io.IOException,
                      Scanner.ScanException,
                      Parser.ParseException,
                      Java.CompileException,
                      java.lang.ClassNotFoundException

SimpleCompiler

public SimpleCompiler(Scanner scanner,
                      java.lang.ClassLoader classLoader)
               throws java.io.IOException,
                      Scanner.ScanException,
                      Parser.ParseException,
                      Java.CompileException
Parse a compilation unit from the given Scanner object and compile it to a set of JavaTM classes.
Parameters:
scanner - Source of tokens
classLoader - Used to load referenced classes
Throws:
java.io.IOException -  
Scanner.ScanException -  
Parser.ParseException -  
Java.CompileException -  
Method Detail

getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns a java.lang.ClassLoader object through which the previously compiled classes can be accessed.