亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? global.java

?? 主要的怎么樣結合java 和 javascript!
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * The contents of this file are subject to the Netscape Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/NPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is Rhino code, released * May 6, 1998. * * The Initial Developer of the Original Code is Netscape * Communications Corporation.  Portions created by Netscape are * Copyright (C) 1997-1999 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * Patrick Beard * Igor Bukanov * Norris Boyd * Rob Ginda * Kurt Westerfeld * Matthias Radestock * * Alternatively, the contents of this file may be used under the * terms of the GNU Public License (the "GPL"), in which case the * provisions of the GPL are applicable instead of those above. * If you wish to allow use of your version of this file only * under the terms of the GPL and not to allow others to use your * version of this file under the NPL, indicate your decision by * deleting the provisions above and replace them with the notice * and other provisions required by the GPL.  If you do not delete * the provisions above, a recipient may use your version of this * file under either the NPL or the GPL. */package org.mozilla.javascript.tools.shell;import java.io.*;import java.net.*;import java.lang.reflect.*;import org.mozilla.javascript.*;import org.mozilla.javascript.tools.ToolErrorReporter;import org.mozilla.javascript.serialize.*;/** * This class provides for sharing functions across multiple threads. * This is of particular interest to server applications. * * @author Norris Boyd */public class Global extends ImporterTopLevel{    static final long serialVersionUID = 4029130780977538005L;    public Global()    {    }    public Global(Context cx)    {        init(cx);    }    public void init(ContextFactory factory)    {        factory.call(new ContextAction() {                public Object run(Context cx)                {                    init(cx);                    return null;                }            });    }    public void init(Context cx)    {        // Define some global functions particular to the shell. Note        // that these functions are not part of ECMA.        initStandardObjects(cx, sealedStdLib);        String[] names = { "print", "quit", "version", "load", "help",                           "loadClass", "defineClass", "spawn", "sync",                           "serialize", "deserialize", "runCommand",                           "seal", "readFile", "readUrl" };        defineFunctionProperties(names, Global.class,                                 ScriptableObject.DONTENUM);        // Set up "environment" in the global scope to provide access to the        // System environment variables.        Environment.defineClass(this);        Environment environment = new Environment(this);        defineProperty("environment", environment,                       ScriptableObject.DONTENUM);        history = (NativeArray) cx.newArray(this, 0);        defineProperty("history", history, ScriptableObject.DONTENUM);        initialized = true;    }    /**     * Print a help message.     *     * This method is defined as a JavaScript function.     */    public static void help(Context cx, Scriptable thisObj,                            Object[] args, Function funObj)    {        PrintStream out = getInstance(funObj).getOut();        out.println(ToolErrorReporter.getMessage("msg.help"));    }    /**     * Print the string values of its arguments.     *     * This method is defined as a JavaScript function.     * Note that its arguments are of the "varargs" form, which     * allows it to handle an arbitrary number of arguments     * supplied to the JavaScript function.     *     */    public static Object print(Context cx, Scriptable thisObj,                               Object[] args, Function funObj)    {        PrintStream out = getInstance(funObj).getOut();        for (int i=0; i < args.length; i++) {            if (i > 0)                out.print(" ");            // Convert the arbitrary JavaScript value into a string form.            String s = Context.toString(args[i]);            out.print(s);        }        out.println();        return Context.getUndefinedValue();    }    /**     * Quit the shell.     *     * This only affects the interactive mode.     *     * This method is defined as a JavaScript function.     */    public static void quit(Context cx, Scriptable thisObj,                            Object[] args, Function funObj)    {        System.exit((args.length > 0) ?                    ((int) Context.toNumber(args[0])) : 0);    }    /**     * Get and set the language version.     *     * This method is defined as a JavaScript function.     */    public static double version(Context cx, Scriptable thisObj,                                 Object[] args, Function funObj)    {        double result = (double) cx.getLanguageVersion();        if (args.length > 0) {            double d = Context.toNumber(args[0]);            cx.setLanguageVersion((int) d);        }        return result;    }    /**     * Load and execute a set of JavaScript source files.     *     * This method is defined as a JavaScript function.     *     */    public static void load(Context cx, Scriptable thisObj,                            Object[] args, Function funObj)    {        for (int i = 0; i < args.length; i++) {            Main.processFile(cx, thisObj, Context.toString(args[i]));        }    }    /**     * Load a Java class that defines a JavaScript object using the     * conventions outlined in ScriptableObject.defineClass.     * <p>     * This method is defined as a JavaScript function.     * @exception IllegalAccessException if access is not available     *            to a reflected class member     * @exception InstantiationException if unable to instantiate     *            the named class     * @exception InvocationTargetException if an exception is thrown     *            during execution of methods of the named class     * @exception ClassDefinitionException if the format of the     *            class causes this exception in ScriptableObject.defineClass     * @see org.mozilla.javascript.ScriptableObject#defineClass     */    public static void defineClass(Context cx, Scriptable thisObj,                                   Object[] args, Function funObj)        throws IllegalAccessException, InstantiationException,               InvocationTargetException    {        Class clazz = getClass(args);        ScriptableObject.defineClass(thisObj, clazz);    }    /**     * Load and execute a script compiled to a class file.     * <p>     * This method is defined as a JavaScript function.     * When called as a JavaScript function, a single argument is     * expected. This argument should be the name of a class that     * implements the Script interface, as will any script     * compiled by jsc.     *     * @exception IllegalAccessException if access is not available     *            to the class     * @exception InstantiationException if unable to instantiate     *            the named class     * @exception InvocationTargetException if an exception is thrown     *            during execution of methods of the named class     * @see org.mozilla.javascript.ScriptableObject#defineClass     */    public static void loadClass(Context cx, Scriptable thisObj,                                 Object[] args, Function funObj)        throws IllegalAccessException, InstantiationException,               InvocationTargetException    {        Class clazz = getClass(args);        if (!Script.class.isAssignableFrom(clazz)) {            throw reportRuntimeError("msg.must.implement.Script");        }        Script script = (Script) clazz.newInstance();        script.exec(cx, thisObj);    }    private static Class getClass(Object[] args)        throws IllegalAccessException, InstantiationException,               InvocationTargetException    {        if (args.length == 0) {            throw reportRuntimeError("msg.expected.string.arg");        }        Object arg0 = args[0];        if (arg0 instanceof Wrapper) {            Object wrapped = ((Wrapper)arg0).unwrap();            if (wrapped instanceof Class)                return (Class)wrapped;        }        String className = Context.toString(args[0]);        try {            return Class.forName(className);        }        catch (ClassNotFoundException cnfe) {            throw reportRuntimeError("msg.class.not.found", className);        }    }    public static void serialize(Context cx, Scriptable thisObj,                                 Object[] args, Function funObj)        throws IOException    {        if (args.length < 2) {            throw Context.reportRuntimeError(                "Expected an object to serialize and a filename to write " +                "the serialization to");        }        Object obj = args[0];        String filename = Context.toString(args[1]);        FileOutputStream fos = new FileOutputStream(filename);        Scriptable scope = ScriptableObject.getTopLevelScope(thisObj);        ScriptableOutputStream out = new ScriptableOutputStream(fos, scope);        out.writeObject(obj);        out.close();    }    public static Object deserialize(Context cx, Scriptable thisObj,                                     Object[] args, Function funObj)        throws IOException, ClassNotFoundException    {        if (args.length < 1) {            throw Context.reportRuntimeError(                "Expected a filename to read the serialization from");        }        String filename = Context.toString(args[0]);        FileInputStream fis = new FileInputStream(filename);        Scriptable scope = ScriptableObject.getTopLevelScope(thisObj);        ObjectInputStream in = new ScriptableInputStream(fis, scope);        Object deserialized = in.readObject();        in.close();        return Context.toObject(deserialized, scope);    }    /**     * The spawn function runs a given function or script in a different     * thread.     *     * js> function g() { a = 7; }     * js> a = 3;     * 3     * js> spawn(g)     * Thread[Thread-1,5,main]     * js> a     * 3     */    public static Object spawn(Context cx, Scriptable thisObj, Object[] args,                               Function funObj)    {        Scriptable scope = funObj.getParentScope();        Runner runner;        if (args.length != 0 && args[0] instanceof Function) {            Object[] newArgs = null;            if (args.length > 1 && args[1] instanceof Scriptable) {                newArgs = cx.getElements((Scriptable) args[1]);            }            if (newArgs == null) { newArgs = ScriptRuntime.emptyArgs; }            runner = new Runner(scope, (Function) args[0], newArgs);        } else if (args.length != 0 && args[0] instanceof Script) {            runner = new Runner(scope, (Script) args[0]);        } else {            throw reportRuntimeError("msg.spawn.args");        }        runner.factory = cx.getFactory();        Thread thread = new Thread(runner);        thread.start();        return thread;    }    /**     * The sync function creates a synchronized function (in the sense     * of a Java synchronized method) from an existing function. The

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人在线免费| 欧美三电影在线| 国产成人啪免费观看软件| 午夜精品久久久久久久99樱桃| 一区二区三区中文在线| 亚洲视频1区2区| 国产精品久久久99| 国产精品午夜免费| 国产精品久久网站| 亚洲欧美电影一区二区| 一区二区三区色| 日韩精品视频网站| 久久精品国产第一区二区三区| 丝瓜av网站精品一区二区| 蜜臀精品久久久久久蜜臀| 性久久久久久久久久久久| 亚洲超碰精品一区二区| 免费三级欧美电影| 国产一区二区0| 国产精品综合网| 成人激情免费电影网址| 色网站国产精品| 色综合激情久久| 日韩一区国产二区欧美三区| 精品国产乱码久久久久久久| 中文字幕av一区二区三区| 一区二区三区在线观看网站| 日韩国产精品久久久久久亚洲| 视频一区二区三区在线| 奇米影视一区二区三区| 久久99精品国产| 国产99久久久国产精品潘金 | 99久久国产综合精品色伊| 99视频精品在线| 欧美日韩1234| 日本一区二区电影| 日韩高清在线不卡| 91香蕉国产在线观看软件| 欧美日本一区二区| 国产精品成人一区二区三区夜夜夜| 午夜国产精品影院在线观看| 国产99一区视频免费| 日韩视频免费观看高清完整版在线观看 | 一区二区三区中文字幕电影| 久久狠狠亚洲综合| 欧洲视频一区二区| 欧美高清在线视频| 久久精品国产免费| 欧美午夜电影在线播放| 国产精品视频第一区| 日本成人在线视频网站| 一本久久a久久免费精品不卡| 亚洲精品一区二区在线观看| 亚洲va国产va欧美va观看| 狠狠色综合色综合网络| 91麻豆免费观看| 中文字幕不卡的av| 国产精品77777竹菊影视小说| 日韩一区二区三区视频在线| 一区二区在线观看视频在线观看| 久久99国产精品麻豆| 欧美精品久久久久久久多人混战 | 精品福利一区二区三区免费视频| 亚洲成av人片| 欧美三级三级三级| 一区二区三区在线视频免费| 一本色道**综合亚洲精品蜜桃冫| 中文字幕一区二区在线播放| 国产精品综合网| 久久日一线二线三线suv| 日韩国产精品久久久久久亚洲| 91浏览器在线视频| 中文欧美字幕免费| 国产激情视频一区二区在线观看| 欧美一级在线视频| 蜜桃精品视频在线| 欧美日韩国产高清一区二区三区 | 欧美tickling网站挠脚心| 免费看精品久久片| 日韩视频在线观看一区二区| 免费高清不卡av| 日韩三级免费观看| 极品少妇xxxx精品少妇| 国产亚洲人成网站| 波多野洁衣一区| 亚洲午夜精品17c| 欧美一级免费大片| 韩国理伦片一区二区三区在线播放| 欧美成人猛片aaaaaaa| 国产精品一区二区免费不卡 | 精品国产乱码久久久久久久久 | 欧美日韩国产精品成人| 毛片不卡一区二区| 久久一区二区三区四区| 懂色av一区二区夜夜嗨| 国产精品视频在线看| 91在线视频免费91| 亚洲国产综合91精品麻豆| 91免费观看在线| 亚洲成人资源在线| 久久人人爽人人爽| 色天使久久综合网天天| 男女激情视频一区| 日本一区二区免费在线| 色哟哟精品一区| 水蜜桃久久夜色精品一区的特点| 日韩免费看网站| 不卡的av电影| 一区二区三区在线视频观看 | 99国产精品久久久久久久久久| 亚洲一区二区在线视频| 久久伊人中文字幕| 欧美日韩中文字幕一区| 国产成人综合亚洲91猫咪| 亚洲午夜精品17c| 国产日韩影视精品| 在线成人免费观看| 91在线视频播放| 国产一区在线观看视频| 亚洲国产成人av网| 国产午夜精品久久| 欧美一级日韩不卡播放免费| 色综合中文字幕| 国产精品一线二线三线| 日韩av不卡一区二区| 亚洲欧美色综合| 久久久久久久久伊人| 777久久久精品| 色呦呦国产精品| 成人午夜精品一区二区三区| 精品在线观看视频| 日韩主播视频在线| 一区二区三区蜜桃网| 国产精品毛片大码女人| 久久久久99精品一区| 日韩免费一区二区三区在线播放| 欧美色图天堂网| 91香蕉视频污在线| 99在线视频精品| 成人免费毛片嘿嘿连载视频| 国产一区二区三区免费播放| 欧美a级一区二区| 日韩中文字幕91| 亚洲五月六月丁香激情| 亚洲男人都懂的| 亚洲男女一区二区三区| 亚洲欧洲99久久| 日韩一区中文字幕| 国产精品久线观看视频| 国产精品色婷婷| 亚洲国产岛国毛片在线| 国产精品嫩草99a| 成人欧美一区二区三区视频网页| 久久久久国产精品免费免费搜索 | 色综合色综合色综合色综合色综合 | 成人毛片老司机大片| 免费观看日韩电影| 玖玖九九国产精品| 国产一区二区影院| 国产不卡视频在线播放| 成人激情小说网站| 91一区二区在线| 欧美性大战久久久久久久| 欧美日韩性生活| 欧美r级电影在线观看| 久久久久久一二三区| 中文字幕乱码久久午夜不卡| 国产精品成人一区二区三区夜夜夜| **欧美大码日韩| 亚洲无线码一区二区三区| 久久国产麻豆精品| 成人爽a毛片一区二区免费| 99精品在线观看视频| 欧美日韩一区二区三区四区| 91精品国产一区二区| 国产亚洲一区二区在线观看| 18成人在线观看| 日本成人中文字幕| 不卡一区二区三区四区| 欧美伊人久久久久久久久影院| 日韩一区二区在线观看视频播放| 久久久久久久综合日本| 亚洲精品欧美专区| 久久电影国产免费久久电影| 不卡电影一区二区三区| 欧美一区中文字幕| 成人欧美一区二区三区小说 | 一本到一区二区三区| 欧美一区二区观看视频| 国产精品嫩草影院av蜜臀| 日韩专区一卡二卡| 99精品在线免费| 精品99一区二区三区| 亚洲精品久久久蜜桃| 韩国理伦片一区二区三区在线播放 | 日韩电影免费一区| 91丨porny丨最新| 欧美精品一区二区三区很污很色的| 国产精品美女久久福利网站 | 中文字幕日韩一区二区|