|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.janino.EvaluatorBase
Utilities for the various "...Evaluator" classes.
| Constructor Summary | |
protected |
EvaluatorBase(java.lang.ClassLoader classLoader)
|
| Method Summary | |
protected Java.ClassDeclaration |
addClassDeclaration(Scanner.Location location,
Java.CompilationUnit compilationUnit,
java.lang.String className,
java.lang.Class extendedType,
java.lang.Class[] implementedTypes)
To the given Java.CompilationUnit, add
A class declaration with the given name, superclass and interfaces
A method declaration with the given return type, name, parameter
names and values and thrown exceptions
|
protected Java.Block |
addClassMethodBlockDeclaration(Scanner.Location location,
Java.CompilationUnit compilationUnit,
java.lang.String className,
java.lang.Class extendedType,
java.lang.Class[] implementedTypes,
java.lang.Class returnType,
java.lang.String methodName,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes,
java.lang.Class[] thrownExceptions)
To the given Java.CompilationUnit, add
A class declaration with the given name, superclass and interfaces
A method declaration with the given return type, name, parameter
names and values and thrown exceptions
A block
|
protected Java.Type[] |
classesToTypes(Scanner.Location location,
java.lang.Class[] classes)
Convert an array of Classes into an array ofJava.Types. |
protected Java.Type |
classToType(Scanner.Location location,
java.lang.Class clazz)
Wrap a reflection Class in a Java.Type object. |
protected java.lang.ClassLoader |
compileAndLoad(Java.CompilationUnit compilationUnit)
Compile the given compilation unit. |
protected java.lang.Class |
compileAndLoad(Java.CompilationUnit compilationUnit,
java.lang.String newClassName)
Compile the given compilation unit, load all generated classes, and return the class with the given name. |
protected Java.FormalParameter[] |
makeFormalParameters(Scanner.Location location,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes)
Convert name and Class-base parameters into an array of
Java.FormalParameters. |
protected void |
parseImportDeclarations(Java.CompilationUnit compilationUnit,
Scanner scanner)
Parse as many import declarations as possible for the given Java.CompilationUnit. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected EvaluatorBase(java.lang.ClassLoader classLoader)
| Method Detail |
protected void parseImportDeclarations(Java.CompilationUnit compilationUnit,
Scanner scanner)
throws Scanner.ScanException,
Parser.ParseException,
java.io.IOException
Java.CompilationUnit.compilationUnit - scanner - Source of tokensScanner.ScanException - Parser.ParseException - java.io.IOException - protected Java.ClassDeclaration addClassDeclaration(Scanner.Location location,
Java.CompilationUnit compilationUnit,
java.lang.String className,
java.lang.Class extendedType,
java.lang.Class[] implementedTypes)
throws Parser.ParseException,
Scanner.ScanException,
java.io.IOException
Java.CompilationUnit, add
location - compilationUnit - className - extendedType - (null == java.lang.Object)implementedTypes - Java.ClassDeclaration objectParser.ParseException - Scanner.ScanException - java.io.IOException - protected Java.Block addClassMethodBlockDeclaration(Scanner.Location location,
Java.CompilationUnit compilationUnit,
java.lang.String className,
java.lang.Class extendedType,
java.lang.Class[] implementedTypes,
java.lang.Class returnType,
java.lang.String methodName,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes,
java.lang.Class[] thrownExceptions)
throws Parser.ParseException,
Scanner.ScanException,
java.io.IOException
Java.CompilationUnit, add
location - compilationUnit - className - extendedType - (null == java.lang.Object)implementedTypes - returnType - methodName - parameterNames - parameterTypes - thrownExceptions - Java.Block objectParser.ParseException - Scanner.ScanException - java.io.IOException - protected Java.Type classToType(Scanner.Location location,
java.lang.Class clazz)
Class in a Java.Type object.protected Java.Type[] classesToTypes(Scanner.Location location,
java.lang.Class[] classes)
Classes into an array ofJava.Types.protected Java.FormalParameter[] makeFormalParameters(Scanner.Location location,
java.lang.String[] parameterNames,
java.lang.Class[] parameterTypes)
Class-base parameters into an array of
Java.FormalParameters.protected java.lang.ClassLoader compileAndLoad(Java.CompilationUnit compilationUnit)
throws Java.CompileException
compilationUnit - The parsed compilation unitjava.lang.ClassLoader object through which the compiled classes can be accessedJava.CompileException - protected java.lang.Class compileAndLoad(Java.CompilationUnit compilationUnit,
java.lang.String newClassName)
throws Java.CompileException,
java.lang.ClassNotFoundException
compilationUnit - newClassName - The fully qualified class nameJava.CompileException - java.lang.ClassNotFoundException - A class with the given name was not declared in the compilation unit
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||