pnuts.ext
Class CachedPnutsImpl
java.lang.Object
|
+--pnuts.lang.PnutsImpl
|
+--pnuts.compiler.CompilerPnutsImpl
|
+--pnuts.ext.CachedPnutsImpl
- public class CachedPnutsImpl
- extends CompilerPnutsImpl
PnutsImpl which caches parsed (compiled) scripts and reuse them.
This class is useful when same scripts are executed over and over,
e.g. servlet scripts.
- See Also:
PnutsImpl
,
CompilerPnutsImpl
Method Summary |
java.lang.Object |
eval(java.lang.String expr,
Context context)
Evaluate an expression |
java.lang.Object |
load(java.net.URL scriptURL,
Context context)
Load a script file from a URL |
void |
reset()
Reset the cache entries |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
CachedPnutsImpl
public CachedPnutsImpl()
CachedPnutsImpl
public CachedPnutsImpl(boolean useCompiler)
- Parameters:
useCompiler
- true if compiler is used (default)
reset
public void reset()
- Reset the cache entries
eval
public java.lang.Object eval(java.lang.String expr,
Context context)
- Evaluate an expression
- Overrides:
- eval in class PnutsImpl
- Parameters:
expr
- the expression to be evaluatedcontext
- the context in which the expression is evaluated- See Also:
Pnuts.eval(String, pnuts.lang.Context)
load
public java.lang.Object load(java.net.URL scriptURL,
Context context)
- Load a script file from a URL
- Overrides:
- load in class PnutsImpl
- Parameters:
scriptURL
- the URL of the scriptcontext
- the context in which the script is executed