| Constructor and Description |
|---|
NashornEvaluator(Class<? extends T> resultType,
Object... vars)
Create a new NashornEvaluator.
|
| Modifier and Type | Method and Description |
|---|---|
T |
eval()
Evaluate the compiled script if it is compiled, or the raw script text otherwise.
|
NashornEvaluator<T> |
put(String varName,
Object var)
Put a varianble into the script environment
|
NashornEvaluator<T> |
script(String scriptText)
Set the script that will be evaluated.
|
public NashornEvaluator(Class<? extends T> resultType, Object... vars)
resultType - The required class of the result type, which must extend generic parameter type t.vars - Optional pairs of names and values. vars[0] is a name, vars[1] is a value, ...public NashornEvaluator<T> script(String scriptText)
public T eval()
public NashornEvaluator<T> put(String varName, Object var)
Copyright © 2017. All rights reserved.