public class JsRuntimeReplFactoryBuilder
extends java.lang.Object
Builder used to setup the javascript runtime to be used by stetho.
You can use this builder to configure the javacript environment by preloading:
Your application context package is automatically visible with this builder.
| Constructor and Description |
|---|
JsRuntimeReplFactoryBuilder(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
JsRuntimeReplFactoryBuilder |
addFunction(java.lang.String name,
Function function)
Adds a function to the javascript environment.
|
JsRuntimeReplFactoryBuilder |
addVariable(java.lang.String name,
java.lang.Object value)
Add a variable (binding) to the javascript environment.
|
RuntimeReplFactory |
build()
Build the runtime REPL instance to be supplied to the Stetho
Runtime module. |
static RuntimeReplFactory |
defaultFactory(android.content.Context context) |
JsRuntimeReplFactoryBuilder |
importClass(java.lang.Class<?> aClass)
Request that the given java class be imported in the javascript runtime.
|
JsRuntimeReplFactoryBuilder |
importPackage(java.lang.String packageName)
Request that the given package name will be imported in the javascript runtime.
|
public JsRuntimeReplFactoryBuilder(android.content.Context context)
public static RuntimeReplFactory defaultFactory(android.content.Context context)
public JsRuntimeReplFactoryBuilder importClass(java.lang.Class<?> aClass)
aClass - the java class to importpublic JsRuntimeReplFactoryBuilder importPackage(java.lang.String packageName)
packageName - the java package name to importpublic JsRuntimeReplFactoryBuilder addVariable(java.lang.String name, java.lang.Object value)
name - the javascript variable namevalue - the value to addpublic JsRuntimeReplFactoryBuilder addFunction(java.lang.String name, Function function)
name - the javascript function namefunction - the functionpublic RuntimeReplFactory build()
Runtime module.