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, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, getExecutorClass, getExecutorsMap, getFunctionProperties, getObjectNames, jsConstructor
protected 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 JSScriptable
context
- public org.mozilla.javascript.Context getJSContext()
getJSContext
in interface JSScriptable
public org.mozilla.javascript.Context createJSContext(java.lang.ClassLoader loader)
createJSContext
in interface JSScriptable
loader
- the ClassLoaderpublic void setDefinedClasses(java.lang.Class<?>... classes)
setDefinedClasses
in interface JSScriptable
classes
- the classespublic java.lang.Class<?>[] getDefinedClasses()
getDefinedClasses
in interface JSScriptable
public boolean addExternalFunction(CachedMethodKey key, java.lang.String methodName, ScriptWrapper wrapper)
addExternalFunction
in interface JSScriptable
key
- the function keymethodName
- the method name to call in the ScriptWrapperwrapper
- the associated ScriptWrapperpublic java.lang.String getClassName()
getClassName
in interface org.mozilla.javascript.Scriptable
getClassName
in class org.mozilla.javascript.ScriptableObject
public ScriptableExecutor getExecutorInstance()
getExecutorInstance
in interface JSScriptable
public java.util.Map<java.lang.String,ScriptableExecutor> getExecutorInstancesMap()
getExecutorInstancesMap
in interface JSScriptable
public void defineExternalFunctions()
defineExternalFunctions
in interface JSScriptable
public void defineFunctionProperties()
JSScriptable
defineFunctionProperties
in interface JSScriptable
public void jsFunction_call(java.lang.Object o)
public void defineBuiltIntFunctions()
defineBuiltIntFunctions
in interface JSScriptable
public 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-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence