• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BSFDeclaredBean类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.bsf.BSFDeclaredBean的典型用法代码示例。如果您正苦于以下问题:Java BSFDeclaredBean类的具体用法?Java BSFDeclaredBean怎么用?Java BSFDeclaredBean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BSFDeclaredBean类属于org.apache.bsf包,在下文中一共展示了BSFDeclaredBean类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException {
    super.initialize(mgr, lang, declaredBeans);

    interpreter = BshUtil.getMasterInterpreter(null);

    // declare the bsf manager for callbacks, etc.
    try {
        interpreter.set("bsf", mgr);
    } catch (EvalError e) {
        throw new BSFException("bsh internal error: "+e.toString());
    }

    for (int i=0; i<declaredBeans.size(); i++) {
        BSFDeclaredBean bean = (BSFDeclaredBean)declaredBeans.get(i);
        declareBean(bean);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:OfbizBshBsfEngine.java


示例2: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/**
 * Initialize the engine.
 */
public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException {
    super.initialize(mgr, lang, declaredBeans);
    ClassLoader parent = mgr.getClassLoader();
    if (parent == null)
        parent = GroovyShell.class.getClassLoader();
    setLoader(mgr, parent);
    execScripts = new HashMap<Object, Class>();
    evalScripts = new HashMap<Object, Class>();
    context = shell.getContext();
    // create a shell
    // register the mgr with object name "bsf"
    context.setVariable("bsf", new BSFFunctions(mgr, this));
    int size = declaredBeans.size();
    for (int i = 0; i < size; i++) {
        declareBean((BSFDeclaredBean) declaredBeans.elementAt(i));
    }
}
 
开发者ID:apache,项目名称:groovy,代码行数:21,代码来源:CachingGroovyEngine.java


示例3: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException {
    super.initialize(mgr, lang, declaredBeans);

    interpreter = BshUtil.getMasterInterpreter(null);

    // declare the bsf manager for callbacks, etc.
    try {
        interpreter.set("bsf", mgr);
    } catch (EvalError e) {
        throw new BSFException("bsh internal error: "+e.toString());
    }

    for(int i=0; i<declaredBeans.size(); i++) {
        BSFDeclaredBean bean = (BSFDeclaredBean)declaredBeans.get(i);
        declareBean(bean);
    }
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:20,代码来源:OfbizBshBsfEngine.java


示例4: declareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@Override
public void declareBean(BSFDeclaredBean bean) throws BSFException {
    try {
        interpreter.set(bean.name, bean.bean);
    } catch (EvalError e) {
        throw new BSFException("error declaring bean: " + bean.name + " : " + e.toString());
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:9,代码来源:OfbizBshBsfEngine.java


示例5: undeclareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@Override
public void undeclareBean(BSFDeclaredBean bean) throws BSFException {
    try {
        interpreter.unset(bean.name);
    } catch (EvalError e) {
        throw new BSFException("bsh internal error: " + e.toString());
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:9,代码来源:OfbizBshBsfEngine.java


示例6: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException {
    super.initialize(mgr, lang, declaredBeans);
    // declare the bsf manager for callbacks, etc.
    context.put("bsf", mgr);
    for (int i = 0; i < declaredBeans.size(); i++) {
        BSFDeclaredBean bean = (BSFDeclaredBean) declaredBeans.get(i);
        declareBean(bean);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:12,代码来源:SimpleMethodBsfEngine.java


示例7: declareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@Override
public void declareBean(BSFDeclaredBean bean) throws BSFException {
    if ((bean.bean instanceof Number) ||
        (bean.bean == null) ||
        (bean.bean instanceof String) ||
        (bean.bean instanceof Boolean)) {
        global.put(bean.name, global, bean.bean);
    }
    else {
        // Must wrap non-scriptable objects before presenting to Rhino
        Scriptable wrapped = Context.toObject(bean.bean, global);
        global.put(bean.name, global, wrapped);
    }
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:15,代码来源:BSFJavaScriptEngine.java


示例8: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/**
 * Initialize the engine.
 * Put the manager into the context-manager
 * map hashtable too.
 */
@Override
public void initialize(BSFManager mgr, String lang,
        @SuppressWarnings("rawtypes") // superclass does not support types
        Vector declaredBeans)
    throws BSFException {

    super.initialize(mgr, lang, declaredBeans);

    // Initialize context and global scope object
    try {
        Context cx = Context.enter();
        global = new ImporterTopLevel(cx);
        Scriptable bsf = Context.toObject(new BSFFunctions(mgr, this), global);
        global.put("bsf", global, bsf);
        @SuppressWarnings("unchecked") // superclass does not support types
        final Vector<BSFDeclaredBean> beans = declaredBeans;
        for (BSFDeclaredBean declaredBean : beans) {
            declareBean(declaredBean);
        }
    }
    catch (Throwable t) {
        handleError(t);
    }
    finally {
        Context.exit();
    }
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:33,代码来源:BSFJavaScriptEngine.java


示例9: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/**
 * Initialize the engine.
 */
public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException {
    super.initialize(mgr, lang, declaredBeans);

    // create a shell
    shell = new GroovyShell(mgr.getClassLoader());

    // register the mgr with object name "bsf"
    shell.setVariable("bsf", new BSFFunctions(mgr, this));

    int size = declaredBeans.size();
    for (int i = 0; i < size; i++) {
        declareBean((BSFDeclaredBean) declaredBeans.elementAt(i));
    }
}
 
开发者ID:apache,项目名称:groovy,代码行数:18,代码来源:GroovyEngine.java


示例10: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
public void initialize (BSFManager mgr,
	  String lang,
	  Vector declaredBeans) throws BSFException {
  super.initialize (mgr, lang, declaredBeans);
  // Reference the REPL class to get primitives loaded.
  Class repl = REPL.class;
  // register the mgr with object name "bsf"
  js.setGlobalValue ("bsf", new BSFFunctions (mgr, this));

  int size = declaredBeans.size ();
  for (int i = 0; i < size; i++)
    declareBean ((BSFDeclaredBean) declaredBeans.elementAt (i));
}
 
开发者ID:dsyang,项目名称:scheme-droid,代码行数:14,代码来源:Engine.java


示例11: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked") // super-class does not use generics
@Override
public void initialize(BSFManager mgr, String lang,
        @SuppressWarnings("rawtypes") Vector declaredBeans) // super-class does not use generics
        throws BSFException {
    super.initialize(mgr, lang, declaredBeans);
    jc = JexlHelper.createContext();
    for (int i = 0; i < declaredBeans.size(); i++) {
        BSFDeclaredBean bean = (BSFDeclaredBean) declaredBeans.elementAt(i);
        jc.getVars().put(bean.name, bean.bean);
    }
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:14,代码来源:JexlEngine.java


示例12: initialize

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/**
 * Initialize the engine.
 * Put the manager into the context-manager
 * map hashtable too.
 */
@Override
public void initialize(BSFManager mgr, String lang,
        @SuppressWarnings("rawtypes") // superclass does not support types
        Vector declaredBeans)
    throws BSFException {

    super.initialize(mgr, lang, declaredBeans);

    // Initialize context and global scope object
    try {
        Context cx = Context.enter();
        global = new ImporterTopLevel(cx);
        Scriptable bsf = Context.toObject(new BSFFunctions(mgr, this), global);
        global.put("bsf", global, bsf);

        for(
            @SuppressWarnings("unchecked")
            Iterator<BSFDeclaredBean> it = declaredBeans.iterator();
            it.hasNext();) {
            declareBean(it.next());
        }
    }
    catch (Throwable t) {
        handleError(t);
    }
    finally {
        Context.exit();
    }
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:35,代码来源:BSFJavaScriptEngine.java


示例13: declareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@Override
public void declareBean(BSFDeclaredBean bean) throws BSFException {
    context.put(bean.name, bean.bean);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:5,代码来源:SimpleMethodBsfEngine.java


示例14: undeclareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@Override
public void undeclareBean(BSFDeclaredBean bean) throws BSFException {
    context.remove(bean.name);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:5,代码来源:SimpleMethodBsfEngine.java


示例15: undeclareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
@Override
public void undeclareBean(BSFDeclaredBean bean) throws BSFException {
    global.delete(bean.name);
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:5,代码来源:BSFJavaScriptEngine.java


示例16: declareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/**
 * Declare a bean
 */
public void declareBean(BSFDeclaredBean bean) throws BSFException {
    shell.setVariable(bean.name, bean.bean);
}
 
开发者ID:apache,项目名称:groovy,代码行数:7,代码来源:GroovyEngine.java


示例17: undeclareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/**
 * Undeclare a previously declared bean.
 */
public void undeclareBean(BSFDeclaredBean bean) throws BSFException {
    shell.setVariable(bean.name, null);
}
 
开发者ID:apache,项目名称:groovy,代码行数:7,代码来源:GroovyEngine.java


示例18: declareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/** A DeclaredBean can be referred to as a free variable. **/
public void declareBean (BSFDeclaredBean bean) throws BSFException {
  js.setGlobalValue(bean.name, bean.bean);
}
 
开发者ID:dsyang,项目名称:scheme-droid,代码行数:5,代码来源:Engine.java


示例19: undeclareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
public void undeclareBean (BSFDeclaredBean bean) throws BSFException {
js.setGlobalValue (bean.name, jsint.U.UNDEFINED);
 }
 
开发者ID:dsyang,项目名称:scheme-droid,代码行数:4,代码来源:Engine.java


示例20: declareBean

import org.apache.bsf.BSFDeclaredBean; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public void declareBean(BSFDeclaredBean bean) throws BSFException {
    jc.getVars().put(bean.name, bean.bean);
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:7,代码来源:JexlEngine.java



注:本文中的org.apache.bsf.BSFDeclaredBean类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ListBox类代码示例发布时间:2022-05-22
下一篇:
Java PooledDataSourceProvider类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap