本文整理汇总了Java中org.mozilla.javascript.IdFunctionObject.sealObject方法的典型用法代码示例。如果您正苦于以下问题:Java IdFunctionObject.sealObject方法的具体用法?Java IdFunctionObject.sealObject怎么用?Java IdFunctionObject.sealObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mozilla.javascript.IdFunctionObject
的用法示例。
在下文中一共展示了IdFunctionObject.sealObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contributeToScope
import org.mozilla.javascript.IdFunctionObject; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void contributeToScope(final Object scope, final boolean trustworthyScript, final boolean mutableScope)
{
if (scope instanceof Scriptable)
{
final IdFunctionObject func = new IdFunctionObject(this, EXECUTE_BATCH_FUNC_TAG, EXECUTE_BATCH_FUNC_ID,
EXECUTE_BATCH_FUNC_NAME, ARITY, (Scriptable) scope);
func.sealObject();
// export as read-only and undeleteable property of the scope
ScriptableObject.defineProperty((Scriptable) scope, EXECUTE_BATCH_FUNC_NAME, func, ScriptableObject.PERMANENT
| ScriptableObject.READONLY);
}
}
开发者ID:AFaust,项目名称:alfresco-enhanced-script-environment,代码行数:18,代码来源:AbstractExecuteBatchFunction.java
示例2: exportFunction
import org.mozilla.javascript.IdFunctionObject; //导入方法依赖的package包/类
protected void exportFunction(final int methodId, final String name, final int arity, final Scriptable scope)
{
final IdFunctionObject func = new IdFunctionObject(this, LOG_FUNC_TAG, methodId, name, arity, scope);
func.sealObject();
// export as read-only and undeleteable property of the scope
ScriptableObject.defineProperty(scope, name, func, ScriptableObject.PERMANENT | ScriptableObject.READONLY);
}
示例3: contributeToScope
import org.mozilla.javascript.IdFunctionObject; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void contributeToScope(final Object scope, final boolean trustworthyScript, final boolean mutableScope)
{
if (scope instanceof Scriptable)
{
final IdFunctionObject func = new IdFunctionObject(this, IMPORT_FUNC_TAG, IMPORT_FUNC_ID, IMPORT_FUNC_NAME, ARITY,
(Scriptable) scope);
func.sealObject();
// export as read-only and undeleteable property of the scope
ScriptableObject.defineProperty((Scriptable) scope, IMPORT_FUNC_NAME, func, ScriptableObject.PERMANENT
| ScriptableObject.READONLY);
}
}