public abstract class AbstractJSScriptable extends org.mozilla.javascript.ScriptableObject implements JSScriptable
| Modifier and Type | Field and Description |
|---|---|
protected ScriptContext |
context
The context of the script wrapper.
|
protected org.mozilla.javascript.Context |
ctx
The Rhino Javascript context.
|
protected java.util.Map<CachedMethodKey,java.lang.reflect.Method> |
functions
The declared functions.
|
| Constructor and Description |
|---|
AbstractJSScriptable() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addExternalFunction(CachedMethodKey key,
java.lang.String methodName,
ScriptWrapper wrapper)
Add an external function.
|
org.mozilla.javascript.Context |
createJSContext(java.lang.ClassLoader loader)
Create the Javascript context associated with this Scriptable.
|
void |
defineBuiltIntFunctions()
Define the BuiltIntFunctions.
|
void |
defineExternalFunctions()
Define the custom functions.
|
void |
defineFunctionProperties()
Define the Function Properties.
|
java.lang.String |
getClassName() |
java.lang.Class<?>[] |
getDefinedClasses()
Return the array of classes to be defined in the context of the wrapper.
|
ScriptableExecutor |
getExecutorInstance()
Return the executor.
|
java.util.Map<java.lang.String,ScriptableExecutor> |
getExecutorInstancesMap()
Return the executors Map.
|
org.mozilla.javascript.Context |
getJSContext()
Return Javascript context.
|
void |
jsFunction_call(java.lang.Object o) |
java.lang.Object |
runScriptMethod(java.lang.String name,
java.lang.Object arg)
Execute a custom method originating from another Script.
|
void |
setContext(ScriptContext context)
Set the context of the script wrapper.
|
void |
setDefinedClasses(java.lang.Class<?>... classes)
Set an array of classes to be defined in the context of the wrapper.
|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecute, getExecutorClass, getExecutorsMap, getFunctionProperties, getObjectNames, jsConstructorprotected java.util.Map<CachedMethodKey,java.lang.reflect.Method> functions
protected ScriptContext context
protected org.mozilla.javascript.Context ctx
public void setContext(ScriptContext context)
setContext in interface JSScriptablecontext - public org.mozilla.javascript.Context getJSContext()
getJSContext in interface JSScriptablepublic org.mozilla.javascript.Context createJSContext(java.lang.ClassLoader loader)
createJSContext in interface JSScriptableloader - the ClassLoaderpublic void setDefinedClasses(java.lang.Class<?>... classes)
setDefinedClasses in interface JSScriptableclasses - the classespublic java.lang.Class<?>[] getDefinedClasses()
getDefinedClasses in interface JSScriptablepublic boolean addExternalFunction(CachedMethodKey key, java.lang.String methodName, ScriptWrapper wrapper)
addExternalFunction in interface JSScriptablekey - the function keymethodName - the method name to call in the ScriptWrapperwrapper - the associated ScriptWrapperpublic java.lang.String getClassName()
getClassName in interface org.mozilla.javascript.ScriptablegetClassName in class org.mozilla.javascript.ScriptableObjectpublic ScriptableExecutor getExecutorInstance()
getExecutorInstance in interface JSScriptablepublic java.util.Map<java.lang.String,ScriptableExecutor> getExecutorInstancesMap()
getExecutorInstancesMap in interface JSScriptablepublic void defineExternalFunctions()
defineExternalFunctions in interface JSScriptablepublic void defineFunctionProperties()
JSScriptabledefineFunctionProperties in interface JSScriptablepublic void jsFunction_call(java.lang.Object o)
public void defineBuiltIntFunctions()
defineBuiltIntFunctions in interface JSScriptablepublic java.lang.Object runScriptMethod(java.lang.String name,
java.lang.Object arg)
name - the name of the method to callarg - the argument of the call.Copyright © 2019-2025 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence