Here you can find the source of copyPropertiesToScriptable(Hashtable properties, Scriptable scriptable)
public static void copyPropertiesToScriptable(Hashtable properties, Scriptable scriptable)
//package com.java2s; //License from project: LGPL import java.util.Enumeration; import java.util.Hashtable; import org.mozilla.javascript.Context; import org.mozilla.javascript.Scriptable; public class Main { public static void copyPropertiesToScriptable(Hashtable properties, Scriptable scriptable) { if (properties == null || scriptable == null) return; Context cx = Context.enter(); try {//www.ja va 2 s .co m for (Enumeration e = properties.keys(); e.hasMoreElements();) { String key = (String) e.nextElement(); Object value = properties.get(key); scriptable.put(key, scriptable, value); } } finally { Context.exit(); } } }