Java Javascript Mozilla Library newObject()

Here you can find the source of newObject()

Description

new Object

License

Mozilla Public License

Declaration

public static Scriptable newObject() 

Method Source Code

//package com.java2s;
/**//from   ww w  .ja va  2  s . c om
 * Copyright 2010-2013 Three Crickets LLC.
 * <p>
 * The contents of this file are subject to the terms of the Mozilla Public
 * License version 1.1: http://www.mozilla.org/MPL/MPL-1.1.html
 * <p>
 * Alternatively, you can obtain a royalty free commercial license with less
 * limitations, transferable or non-transferable, directly from Three Crickets
 * at http://threecrickets.com/
 */

import org.mozilla.javascript.Context;

import org.mozilla.javascript.ScriptRuntime;
import org.mozilla.javascript.Scriptable;

public class Main {
    public static Scriptable newObject() {
        Context context = Context.getCurrentContext();
        Scriptable scope = ScriptRuntime.getTopCallScope(context);
        return context.newObject(scope);
    }
}

Related

  1. jsToJava(Object obj)
  2. listToNativeArray(List list)
  3. mapJSToJava(final Object jsObject)
  4. mapToNativeObject(Map map)
  5. nativeArrayToString(Object scriptObject)
  6. numberArg(Object[] args, int pos)
  7. objArg(Object[] args, int pos, Class type, boolean required)
  8. objectToXMLString(Object xml)
  9. omitLineBreak(AstNode node)