- Direct Known Subclasses:
Drunner
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Charsetprotected final com.pervasive.datarush.coercion.ContextManagerprotected final org.mozilla.javascript.Scriptable -
Constructor Summary
ConstructorsConstructorDescriptionJavaScriptRunner(com.pervasive.datarush.coercion.ContextManager contextManager) -
Method Summary
Modifier and TypeMethodDescriptionentrySet()eval(File sourceFile, CodeSource securityDomain) eval(String source, CodeSource securityDomain) eval(URL sourceUrl, CodeSource securityDomain) static JavaScriptRunnerfromArgs(String[] args, CodeSource domain) <T> TGets the value to which the specified key is mapped, and coerces that value to the specified target type.static ObjectvoidprocessCliArgs(String[] args, CodeSource domain) <T> TGets the value to which the specified key is mapped, and coerces that value to a specified type.Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
charset
-
contextManager
protected final com.pervasive.datarush.coercion.ContextManager contextManager -
scope
protected final org.mozilla.javascript.Scriptable scope
-
-
Constructor Details
-
JavaScriptRunner
public JavaScriptRunner(com.pervasive.datarush.coercion.ContextManager contextManager)
-
-
Method Details
-
getAs
Gets the value to which the specified key is mapped, and coerces that value to the specified target type. If this map contains no mapping for the key, a specified default value is returned instead.- Type Parameters:
T- the target type- Parameters:
targetType- the type to coerce the retrieved value tokey- the key of the value to retrievedefaultValue- the default value- Returns:
- the value, coerced to
targetType, to whichkeyis mapped ordefaultValue - See Also:
-
#getAs(Class, String)
-
requireAs
Gets the value to which the specified key is mapped, and coerces that value to a specified type. If this map contains no mapping for the key, or the key is mapped to a null value, a user-friendly exception is thrown.- Type Parameters:
T- the target type- Parameters:
targetType- the type to coerce the retrieved value tokey- the key of the value to retrieve- Returns:
- the value, coerced to
valueType, to whichkeyis mapped
-
eval
-
eval
-
eval
-
processCliArgs
-
fromArgs
-
entrySet
-
put
-
jsToJava
-