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

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

?? nativejavaobject.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, 1999. * * The Initial Developer of the Original Code is Netscape * Communications Corporation.  Portions created by Netscape are * Copyright (C) 1997-2000 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * Norris Boyd * Igor Bukanov * Frank Mitchell * Mike Shaver * Kemal Bayram * * 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;import java.io.*;import java.lang.reflect.*;import java.util.Hashtable;import java.util.Date;/** * This class reflects non-Array Java objects into the JavaScript environment.  It * reflect fields directly, and uses NativeJavaMethod objects to reflect (possibly * overloaded) methods.<p> * * @author Mike Shaver * @see NativeJavaArray * @see NativeJavaPackage * @see NativeJavaClass */public class NativeJavaObject implements Scriptable, Wrapper, Serializable{    static final long serialVersionUID = -6948590651130498591L;    public NativeJavaObject() { }    public NativeJavaObject(Scriptable scope, Object javaObject,                            Class staticType)    {        this.parent = scope;        this.javaObject = javaObject;        this.staticType = staticType;        initMembers();    }    protected void initMembers() {        Class dynamicType;        if (javaObject != null) {            dynamicType = javaObject.getClass();        } else {            dynamicType = staticType;        }        members = JavaMembers.lookupClass(parent, dynamicType, staticType);        fieldAndMethods            = members.getFieldAndMethodsObjects(this, javaObject, false);    }    public boolean has(String name, Scriptable start) {        return members.has(name, false);    }    public boolean has(int index, Scriptable start) {        return false;    }    public Object get(String name, Scriptable start) {        if (fieldAndMethods != null) {            Object result = fieldAndMethods.get(name);            if (result != null) {                return result;            }        }        // TODO: passing 'this' as the scope is bogus since it has        //  no parent scope        return members.get(this, name, javaObject, false);    }    public Object get(int index, Scriptable start) {        throw members.reportMemberNotFound(Integer.toString(index));    }    public void put(String name, Scriptable start, Object value) {        // We could be asked to modify the value of a property in the        // prototype. Since we can't add a property to a Java object,        // we modify it in the prototype rather than copy it down.        if (prototype == null || members.has(name, false))            members.put(this, name, javaObject, value, false);        else            prototype.put(name, prototype, value);    }    public void put(int index, Scriptable start, Object value) {        throw members.reportMemberNotFound(Integer.toString(index));    }    public boolean hasInstance(Scriptable value) {        // This is an instance of a Java class, so always return false        return false;    }    public void delete(String name) {    }    public void delete(int index) {    }    public Scriptable getPrototype() {        if (prototype == null && javaObject instanceof String) {            return ScriptableObject.getClassPrototype(parent, "String");        }        return prototype;    }    /**     * Sets the prototype of the object.     */    public void setPrototype(Scriptable m) {        prototype = m;    }    /**     * Returns the parent (enclosing) scope of the object.     */    public Scriptable getParentScope() {        return parent;    }    /**     * Sets the parent (enclosing) scope of the object.     */    public void setParentScope(Scriptable m) {        parent = m;    }    public Object[] getIds() {        return members.getIds(false);    }/**@deprecated Use {@link Context#getWrapFactory()} together with calling {@linkWrapFactory#wrap(Context cx, Scriptable scope, Object obj, Class)}*/    public static Object wrap(Scriptable scope, Object obj, Class staticType) {        Context cx = Context.getContext();        return cx.getWrapFactory().wrap(cx, scope, obj, staticType);    }    public Object unwrap() {        return javaObject;    }    public String getClassName() {        return "JavaObject";    }    public Object getDefaultValue(Class hint)    {        Object value;        if (hint == null) {            if (javaObject instanceof Boolean) {                hint = ScriptRuntime.BooleanClass;            }        }        if (hint == null || hint == ScriptRuntime.StringClass) {            value = javaObject.toString();        } else {            String converterName;            if (hint == ScriptRuntime.BooleanClass) {                converterName = "booleanValue";            } else if (hint == ScriptRuntime.NumberClass) {                converterName = "doubleValue";            } else {                throw Context.reportRuntimeError0("msg.default.value");            }            Object converterObject = get(converterName, this);            if (converterObject instanceof Function) {                Function f = (Function)converterObject;                value = f.call(Context.getContext(), f.getParentScope(),                               this, ScriptRuntime.emptyArgs);            } else {                if (hint == ScriptRuntime.NumberClass                    && javaObject instanceof Boolean)                {                    boolean b = ((Boolean)javaObject).booleanValue();                    value = ScriptRuntime.wrapNumber(b ? 1.0 : 0.0);                } else {                    value = javaObject.toString();                }            }        }        return value;    }    /**     * Determine whether we can/should convert between the given type and the     * desired one.  This should be superceded by a conversion-cost calculation     * function, but for now I'll hide behind precedent.     */    public static boolean canConvert(Object fromObj, Class to) {        int weight = getConversionWeight(fromObj, to);        return (weight < CONVERSION_NONE);    }    private static final int JSTYPE_UNDEFINED   = 0; // undefined type    private static final int JSTYPE_NULL        = 1; // null    private static final int JSTYPE_BOOLEAN     = 2; // boolean    private static final int JSTYPE_NUMBER      = 3; // number    private static final int JSTYPE_STRING      = 4; // string    private static final int JSTYPE_JAVA_CLASS  = 5; // JavaClass    private static final int JSTYPE_JAVA_OBJECT = 6; // JavaObject    private static final int JSTYPE_JAVA_ARRAY  = 7; // JavaArray    private static final int JSTYPE_OBJECT      = 8; // Scriptable    static final byte CONVERSION_TRIVIAL      = 1;    static final byte CONVERSION_NONTRIVIAL   = 0;    static final byte CONVERSION_NONE         = 99;    /**     * Derive a ranking based on how "natural" the conversion is.     * The special value CONVERSION_NONE means no conversion is possible,     * and CONVERSION_NONTRIVIAL signals that more type conformance testing     * is required.     * Based on     * <a href="http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html">     * "preferred method conversions" from Live Connect 3</a>     */    static int getConversionWeight(Object fromObj, Class to) {        int fromCode = getJSTypeCode(fromObj);        switch (fromCode) {        case JSTYPE_UNDEFINED:            if (to == ScriptRuntime.StringClass ||                to == ScriptRuntime.ObjectClass) {                return 1;            }            break;        case JSTYPE_NULL:            if (!to.isPrimitive()) {                return 1;            }            break;        case JSTYPE_BOOLEAN:            // "boolean" is #1            if (to == Boolean.TYPE) {                return 1;            }            else if (to == ScriptRuntime.BooleanClass) {                return 2;            }            else if (to == ScriptRuntime.ObjectClass) {                return 3;            }            else if (to == ScriptRuntime.StringClass) {                return 4;            }            break;        case JSTYPE_NUMBER:            if (to.isPrimitive()) {                if (to == Double.TYPE) {                    return 1;                }                else if (to != Boolean.TYPE) {                    return 1 + getSizeRank(to);                }            }            else {                if (to == ScriptRuntime.StringClass) {                    // native numbers are #1-8                    return 9;                }                else if (to == ScriptRuntime.ObjectClass) {                    return 10;                }                else if (ScriptRuntime.NumberClass.isAssignableFrom(to)) {                    // "double" is #1                    return 2;                }            }            break;        case JSTYPE_STRING:            if (to == ScriptRuntime.StringClass) {                return 1;            }            else if (to.isInstance(fromObj)) {                return 2;            }            else if (to.isPrimitive()) {                if (to == Character.TYPE) {                    return 3;                } else if (to != Boolean.TYPE) {                    return 4;                }            }            break;        case JSTYPE_JAVA_CLASS:            if (to == ScriptRuntime.ClassClass) {                return 1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美另类图片小说| 天堂成人免费av电影一区| 色噜噜久久综合| 亚洲一区二区三区美女| 丝袜美腿一区二区三区| 国产一区三区三区| 91精品国产一区二区三区| 偷窥国产亚洲免费视频| 欧美军同video69gay| 国产日韩av一区二区| 国产精品久久久久久久久晋中| 国产日韩欧美精品在线| 91福利视频久久久久| 欧美区视频在线观看| 久久久91精品国产一区二区三区| 欧美性做爰猛烈叫床潮| 成人av电影在线观看| 国产一区二区久久| 欧美aaaaaa午夜精品| 亚洲国产日韩av| 国产精品久久毛片av大全日韩| 久久亚洲二区三区| 精品黑人一区二区三区久久| 欧美日韩国产另类不卡| 色综合网站在线| www.一区二区| 成人精品鲁一区一区二区| 激情文学综合插| 美国十次了思思久久精品导航| 亚洲国产精品天堂| 亚洲一区二区在线视频| 亚洲精品写真福利| 亚洲少妇屁股交4| 亚洲私人影院在线观看| 亚洲欧洲韩国日本视频| 中文字幕在线不卡一区二区三区| 中文字幕第一区第二区| 国产精品麻豆一区二区| 国产精品乱人伦中文| 亚洲国产成人自拍| 中文字幕在线视频一区| 综合久久久久综合| 亚洲手机成人高清视频| 专区另类欧美日韩| 亚洲综合精品久久| 午夜av区久久| 毛片基地黄久久久久久天堂| 蜜桃av噜噜一区| 精品综合久久久久久8888| 国产一区不卡在线| 粉嫩av一区二区三区| 91在线视频18| 欧美日韩一区二区三区四区 | 成人手机在线视频| 精品国产乱码久久| 欧美大片在线观看| 欧美精品一区二区三区很污很色的 | 日韩欧美一级精品久久| 精品理论电影在线观看| 国产婷婷精品av在线| 中文字幕一区二区三区视频| 亚洲日本va在线观看| 亚洲午夜在线视频| 日韩av在线播放中文字幕| 免费亚洲电影在线| 国产精品亚洲а∨天堂免在线| av动漫一区二区| 91高清在线观看| 91精品国模一区二区三区| 亚洲精品在线电影| 中文字幕一区二区三区在线观看 | 国产精品综合视频| 99久久er热在这里只有精品15| 欧美调教femdomvk| 欧美精品一区在线观看| 久久综合资源网| jizzjizzjizz欧美| 91麻豆国产精品久久| 欧美三级午夜理伦三级中视频| 日韩欧美一级二级| 亚洲欧洲av在线| 蜜臀av一区二区在线免费观看 | 久久精品99久久久| 国产成人av电影| 欧美日韩亚洲综合在线| 国产日产欧美一区二区三区| 亚洲一二三四在线| 国产九色sp调教91| 欧美在线一二三| 国产日韩成人精品| 日韩影院免费视频| 色综合一个色综合亚洲| 精品久久久久久久久久久久包黑料 | 欧美精品第1页| 国产亚洲人成网站| 偷拍与自拍一区| 亚洲男人的天堂在线观看| 自拍偷拍亚洲综合| 久久99精品久久久久久动态图| 99re热这里只有精品免费视频| 欧美一区二区三级| 亚洲自拍偷拍图区| 成人性生交大片免费看视频在线| 欧美精品18+| 亚洲精品视频观看| 国产成人午夜片在线观看高清观看| 欧美亚洲国产一卡| 国产欧美日韩激情| 久草热8精品视频在线观看| 日本高清免费不卡视频| 中文字幕av资源一区| 韩国三级中文字幕hd久久精品| 欧美精品高清视频| 亚洲在线视频网站| 99re66热这里只有精品3直播| 欧美精品一区二区三区蜜臀| 奇米色一区二区三区四区| 欧美日韩亚州综合| 亚洲一二三四久久| 色网站国产精品| ㊣最新国产の精品bt伙计久久| 国产精品影视天天线| 日韩精品中文字幕一区二区三区| 日产欧产美韩系列久久99| 欧美日韩mp4| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 久久婷婷色综合| 天堂久久久久va久久久久| 欧美性xxxxx极品少妇| 一区二区三区在线看| 色综合久久99| 亚洲激情网站免费观看| 色婷婷久久一区二区三区麻豆| 亚洲视频一区二区在线观看| 91丨porny丨户外露出| 中文字幕中文字幕在线一区 | 亚洲欧美在线aaa| 99久久99久久综合| 亚洲精品国产视频| 91国在线观看| 亚洲成av人影院| 91精品欧美综合在线观看最新| 免费观看一级特黄欧美大片| 日韩一卡二卡三卡四卡| 久久精品国产精品亚洲精品| 欧美精品一区视频| 岛国精品在线观看| 亚洲成av人**亚洲成av**| 一区二区国产盗摄色噜噜| 91论坛在线播放| 一区二区三区精密机械公司| 日本大香伊一区二区三区| 亚洲综合成人网| 欧美一级高清片| 国产一区二区三区在线观看免费视频 | 日韩精品一二区| 日韩欧美久久一区| 国产成人鲁色资源国产91色综| 中文字幕日韩一区| 欧美午夜精品一区二区蜜桃| 日韩福利视频导航| 久久精品视频网| 色偷偷久久人人79超碰人人澡| 日韩精品一二三四| 日本一区二区三区四区| 色综合久久综合| 免费高清视频精品| 中文字幕一区二区三区色视频 | av中文字幕在线不卡| 亚洲高清在线精品| 精品国产免费视频| 99r国产精品| 老鸭窝一区二区久久精品| 国产精品久久久久久久岛一牛影视| 欧美色精品天天在线观看视频| 国内精品国产三级国产a久久| 中文字幕视频一区二区三区久| 欧美性xxxxx极品少妇| 国产一区二区三区黄视频 | 国产精品资源在线看| 一区二区三区中文字幕| 欧美成人三级电影在线| 99re66热这里只有精品3直播 | 在线观看日韩电影| 国产精品综合视频| 亚洲va中文字幕| 国产精品热久久久久夜色精品三区 | 欧美日韩在线观看一区二区 | 国产一区三区三区| 亚洲一区二区三区四区在线免费观看| 欧美大片在线观看一区二区| 91精品1区2区| 丁香网亚洲国际| 免费久久99精品国产| 一区二区三区资源| 中文字幕第一区二区| 精品99一区二区三区| 欧美日韩精品欧美日韩精品一综合| 成人av高清在线| 国产精品资源在线|