Package com.ibm.di.script
Class ScriptEngineOptions
- java.lang.Object
-
- com.ibm.jscript.JSContext
-
- com.ibm.di.script.ScriptEngineOptions
-
public class ScriptEngineOptions extends com.ibm.jscript.JSContextThis class configures the IBM JS script engine. Since 2.2 The isDebugAllowed is now final static so setDebugAllowed were removed to comply with the new JSContext interface. Since 2.0 ScriptEngineOptions is no longer just an options class. It also provides the isDebugAllowed() method that is different for each instance of the engine. Although this could be a static hastable with reference to the current thread, the overhead of allocating a new JSContext is fairly small since we don't use the script caching features of the JSContext.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceScriptEngineOptions.TDIDebugListener
-
Constructor Summary
Constructors Constructor Description ScriptEngineOptions()ScriptEngineOptions(boolean useCache, boolean debug)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDebugListener(ScriptEngineOptions.TDIDebugListener listener)booleanautoConvertJavaArgsToString()static voidclearNoClassSet()Clear the set containing strings that are not classes.voiddebugStatement(com.ibm.jscript.ASTTree.ASTNode statement, com.ibm.jscript.engine.IExecutionContext context)Called by ASTDebugstatic com.ibm.jscript.JSContextget()Returns a context with no debugging and cache disabledstatic com.ibm.jscript.JSContextget(boolean debug)Returns a context with debugging enabled and cache disabledjava.beans.BeanInfogetBeanInfo(java.lang.Class<?> clazz)com.ibm.jscript.IValuegetProperty(java.lang.Object object, java.lang.String propertyName)intgetSourceTabSize()booleanhasGlobalObjectExtensions()booleanhasJavaBeanAccess()booleanhasJUnitExtensions()booleanhasListOperator()booleanhasMathExtensions()booleanhasObjectPrototypeExtensions()booleanhasRhinoExtensions()booleanhasStringExtendedMethods()booleanhasStringLengthAsMethod()booleanignoreJavaCallAmbiguities()booleanisDebug()java.lang.ClassloadClass(java.lang.String className)Overrides the default loadClass, to remember strings that are not classes.booleanputProperty(java.lang.Object object, java.lang.String propertyName, com.ibm.jscript.IValue value)voidremoveDebugListener(ScriptEngineOptions.TDIDebugListener listener)com.ibm.jscript.types.JavaWrapperObjectwrapObject(java.lang.Object o)-
Methods inherited from class com.ibm.jscript.JSContext
addDesignTimeClassLoader, createExpression, createExpression, evaluateConstant, evaluateConstantAsString, getAccessControlContext, getASTProgram, getCachedExpression, getClassInfo, getDesignTimeClassLoaders, getExpression, getExpression, getExpression, getExpression, getExpression, getExpression, getExpressionCache, getJsonFactory, getLibraryInitializer, getPropertyResolver, getRegistry, getStandardStream, getStaticContext, getTempExecutionContext, getVersion, hasDefaultListOp, hasExpressionCache, hasJavaBridge, hasJSLibrary, hasRhinoProtoExtensions, includeCallerFunctionContext, init, isDebugAllowed, isJavaConstructorAllowed, isJavaFieldAllowed, isJavaMethodAllowed, isJavaPropertyAllowed, isRuntimeOptimized, loadLibrary, parseScript, print, println, putCachedExpression, putClassInfo, setJsonFactory, setLibraryInitializer, setPropertyResolver, setVersion, useGeneratedWrappers
-
-
-
-
Method Detail
-
get
public static com.ibm.jscript.JSContext get()
Returns a context with no debugging and cache disabled- Returns:
- a context.
-
get
public static com.ibm.jscript.JSContext get(boolean debug)
Returns a context with debugging enabled and cache disabled- Returns:
- a context.
-
addDebugListener
public void addDebugListener(ScriptEngineOptions.TDIDebugListener listener)
-
removeDebugListener
public void removeDebugListener(ScriptEngineOptions.TDIDebugListener listener)
-
isDebug
public boolean isDebug()
-
debugStatement
public void debugStatement(com.ibm.jscript.ASTTree.ASTNode statement, com.ibm.jscript.engine.IExecutionContext context) throws com.ibm.jscript.JavaScriptExceptionCalled by ASTDebug- Parameters:
statement- The statement about to be executedcontext- The context in which the statement executes- Throws:
com.ibm.jscript.JavaScriptException
-
hasStringLengthAsMethod
public boolean hasStringLengthAsMethod()
- Overrides:
hasStringLengthAsMethodin classcom.ibm.jscript.JSContext- Returns:
- true
-
hasStringExtendedMethods
public boolean hasStringExtendedMethods()
- Overrides:
hasStringExtendedMethodsin classcom.ibm.jscript.JSContext- Returns:
- true
-
hasGlobalObjectExtensions
public boolean hasGlobalObjectExtensions()
- Overrides:
hasGlobalObjectExtensionsin classcom.ibm.jscript.JSContext- Returns:
- true
-
hasJUnitExtensions
public boolean hasJUnitExtensions()
- Overrides:
hasJUnitExtensionsin classcom.ibm.jscript.JSContext- Returns:
- false
-
hasObjectPrototypeExtensions
public boolean hasObjectPrototypeExtensions()
- Overrides:
hasObjectPrototypeExtensionsin classcom.ibm.jscript.JSContext- Returns:
- true
-
hasMathExtensions
public boolean hasMathExtensions()
- Overrides:
hasMathExtensionsin classcom.ibm.jscript.JSContext- Returns:
- true
-
hasListOperator
public boolean hasListOperator()
- Returns:
- false
-
hasRhinoExtensions
public boolean hasRhinoExtensions()
- Overrides:
hasRhinoExtensionsin classcom.ibm.jscript.JSContext- Returns:
- true
-
hasJavaBeanAccess
public boolean hasJavaBeanAccess()
- Overrides:
hasJavaBeanAccessin classcom.ibm.jscript.JSContext- Returns:
- true
-
autoConvertJavaArgsToString
public boolean autoConvertJavaArgsToString()
- Overrides:
autoConvertJavaArgsToStringin classcom.ibm.jscript.JSContext- Returns:
- true
-
ignoreJavaCallAmbiguities
public boolean ignoreJavaCallAmbiguities()
- Overrides:
ignoreJavaCallAmbiguitiesin classcom.ibm.jscript.JSContext- Returns:
- true
-
getProperty
public com.ibm.jscript.IValue getProperty(java.lang.Object object, java.lang.String propertyName) throws com.ibm.jscript.InterpretException- Overrides:
getPropertyin classcom.ibm.jscript.JSContext- Throws:
com.ibm.jscript.InterpretException
-
getBeanInfo
public java.beans.BeanInfo getBeanInfo(java.lang.Class<?> clazz) throws java.beans.IntrospectionException- Overrides:
getBeanInfoin classcom.ibm.jscript.JSContext- Throws:
java.beans.IntrospectionException
-
putProperty
public boolean putProperty(java.lang.Object object, java.lang.String propertyName, com.ibm.jscript.IValue value) throws com.ibm.jscript.InterpretException- Overrides:
putPropertyin classcom.ibm.jscript.JSContext- Throws:
com.ibm.jscript.InterpretException
-
wrapObject
public com.ibm.jscript.types.JavaWrapperObject wrapObject(java.lang.Object o)
- Overrides:
wrapObjectin classcom.ibm.jscript.JSContext
-
loadClass
public java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundExceptionOverrides the default loadClass, to remember strings that are not classes.- Overrides:
loadClassin classcom.ibm.jscript.JSContext- Throws:
java.lang.ClassNotFoundException
-
clearNoClassSet
public static void clearNoClassSet()
Clear the set containing strings that are not classes. This method is useful to call after adding new jars to the class loader.
-
getSourceTabSize
public int getSourceTabSize()
- Overrides:
getSourceTabSizein classcom.ibm.jscript.JSContext
-
-