public class EvaluatorHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
grepImportPattern
Regex to match import:
- "^(import ...;)" for import at line beginning
- ";(import ...;)" for multiple import on same line
|
| Constructor and Description |
|---|
EvaluatorHelper() |
| Modifier and Type | Method and Description |
|---|---|
static int |
check(Class javaInterface,
String script,
PrintWriter out)
Verifie si un script (prescript/equation) est syntaxiquement correct.
|
protected static void |
compile(File fileRootSrc,
File fileSrc) |
static Object |
evaluate(String packageName,
String className,
Class javaInterface,
String script,
Object... args)
Evalue une equation.
|
protected static String |
generateContent(String packageName,
String className,
Method interfaceMethod,
String script)
Generate script content.
|
protected static String |
getHashCache(File fileCheckSum) |
protected static void |
grepImport(String code,
StringBuilder imports,
StringBuilder others)
looking for import in code. return all import as found in code in imports args
all other code are put in others
|
protected static Object |
invoke(Class clazz,
Method interfaceMethod,
Object... args) |
protected static String |
normalizeClassName(String name) |
protected static void |
setHashCache(File fileCheckSum,
String hashcode) |
protected static Pattern grepImportPattern
public static int check(Class javaInterface, String script, PrintWriter out)
javaInterface - script - out - output writer (can be null for non output)public static Object evaluate(String packageName, String className, Class javaInterface, String script, Object... args)
packageName - le nom de package de la classeclassName - le nom de la classejavaInterface - l'interface que la classe doit etendre,
cette interface n'a qu'un methodescript - le code de la methodeargs - les arguments a utiliser pour l'appel de la methodeprotected static String generateContent(String packageName, String className, Method interfaceMethod, String script)
packageName - className - interfaceMethod - script - protected static void grepImport(String code, StringBuilder imports, StringBuilder others)
code - imports - others - Copyright © 1999–2014 CodeLutin. All rights reserved.