Java Javascript Mozilla Library copyPropertiesToScriptable(Hashtable properties, Scriptable scriptable)

Here you can find the source of copyPropertiesToScriptable(Hashtable properties, Scriptable scriptable)

Description

copy Properties To Scriptable

License

LGPL

Declaration

public static void copyPropertiesToScriptable(Hashtable properties, Scriptable scriptable) 

Method Source Code

//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();
        }
    }
}

Related

  1. asObject(final Scriptable scope, final Map map)
  2. booleanValue(String name, Scriptable scope)
  3. callFn(Function function, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
  4. convertArray(NativeArray jsArray)
  5. convertObject(NativeObject jsObject, Map identities)
  6. copyScope(Context context, Scriptable scope)
  7. copyScriptableToProperties(Scriptable scriptable, Map properties)
  8. createJavaAdapterArgs(Scriptable scope, Class[] ifaces, Object jsImpl)
  9. createNativeArray(int length, Scriptable scope)