ScriptExecutor.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:neoscada 作者:
protected Map<String, Object> applyVars ( final ScriptContext context, final Map<String, Object> scriptObjects )
{
    if ( scriptObjects == null || scriptObjects.isEmpty () )
    {
        return null;
    }

    final Map<String, Object> replaced = new HashMap<String, Object> ();
    for ( final Map.Entry<String, Object> entry : scriptObjects.entrySet () )
    {
        final Object original = context.getAttribute ( entry.getKey (), ScriptContext.ENGINE_SCOPE );
        replaced.put ( entry.getKey (), original );
        context.setAttribute ( entry.getKey (), entry.getValue (), ScriptContext.ENGINE_SCOPE );
    }
    return replaced;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号