亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美激情一区二区三区不卡| 精品美女在线观看| 精品国产乱码久久久久久久久| 亚洲婷婷在线视频| 91视视频在线观看入口直接观看www| 久久综合久久综合久久| 国产一区二区精品在线观看| 久久网站热最新地址| 国产一区二区毛片| 国产精品天美传媒| 91在线播放网址| 亚洲va中文字幕| 欧美久久久久久久久中文字幕| 免费在线视频一区| 久久精品亚洲精品国产欧美kt∨ | 欧美高清性hdvideosex| 免费久久精品视频| 国产欧美一区二区精品性| 99精品视频在线观看| 亚洲一级在线观看| 久久久久久久综合| 欧美日韩专区在线| 国产毛片精品视频| 亚洲小少妇裸体bbw| 国产三级精品视频| 91精品国模一区二区三区| 丁香另类激情小说| 亚洲欧美日韩久久| 欧美一区二区三区性视频| 国产不卡免费视频| 免费观看在线综合| 亚洲乱码精品一二三四区日韩在线| 精品国产欧美一区二区| 欧美亚洲一区二区三区四区| 国产91精品一区二区麻豆网站| 天堂影院一区二区| 亚洲精品久久嫩草网站秘色| 中文字幕免费一区| 久久精品一区蜜桃臀影院| 欧美福利视频导航| 欧美日韩一区二区三区不卡| 一本色道久久综合亚洲aⅴ蜜桃| 欧美日韩亚洲综合在线| 色婷婷精品久久二区二区蜜臂av| 成人网在线免费视频| 国产成人av电影在线| 国精品**一区二区三区在线蜜桃| 蜜桃av一区二区三区| 麻豆精品一区二区av白丝在线| 午夜精品成人在线视频| 日本91福利区| 黑人巨大精品欧美黑白配亚洲| 国模一区二区三区白浆| 国产黄色精品网站| 成人精品小蝌蚪| 色94色欧美sute亚洲线路一久| 欧美视频在线播放| 欧美精品久久99久久在免费线| 日韩一区二区三区视频在线| 精品少妇一区二区三区在线播放 | 欧美卡1卡2卡| 精品久久久久久久久久久久久久久 | 中文字幕一区二区在线观看| 国产精品麻豆一区二区| 亚洲一区中文在线| 麻豆视频一区二区| 91在线码无精品| 3d动漫精品啪啪| 亚洲国产激情av| 亚瑟在线精品视频| 高清国产一区二区| 欧美三片在线视频观看| 欧美大黄免费观看| 国产精品美女久久久久av爽李琼| 国产a精品视频| 欧美一区日韩一区| 国精产品一区一区三区mba视频 | 精品在线观看免费| 日本高清不卡aⅴ免费网站| 日韩欧美123| 国产福利一区在线| 日韩精品一区二区三区中文不卡 | 欧美日韩高清影院| 国产精品伦一区| 国产成人在线视频播放| 欧美精品久久99久久在免费线| 亚洲欧洲日韩av| www.成人网.com| 国产精品美女一区二区三区| 久久精品国产精品青草| 在线播放一区二区三区| 亚洲精品福利视频网站| 成人丝袜高跟foot| 欧美精品一区在线观看| 日本亚洲免费观看| 制服丝袜日韩国产| 日韩一区精品字幕| 日韩一区二区在线免费观看| 性做久久久久久久久| 91精品国产一区二区三区 | 国产一区二区三区视频在线播放| 日韩亚洲欧美成人一区| 麻豆精品一区二区三区| 日韩午夜电影在线观看| 国产在线精品一区二区不卡了 | 国产精品成人一区二区艾草 | 欧美一卡在线观看| 精品一二线国产| 国产日韩精品一区二区浪潮av| 成人一区二区三区| 亚洲欧洲国产日韩| 5月丁香婷婷综合| 国产成人a级片| 一区二区三区欧美日| 欧美一区二区三区影视| 成人a区在线观看| 亚洲二区在线视频| 久久这里只有精品视频网| 91色在线porny| 精品一区二区三区免费毛片爱| 国产精品色哟哟| 欧美一区二区三区小说| 成人性生交大片免费看在线播放| 一区二区三区在线免费观看| 欧美变态tickling挠脚心| 97精品超碰一区二区三区| 日韩高清在线观看| 亚洲欧美另类综合偷拍| 久久久久久久久蜜桃| 777午夜精品免费视频| 91麻豆免费看片| 国产成人在线电影| 久久91精品国产91久久小草| 亚洲成a人v欧美综合天堂下载| 久久综合一区二区| 日韩欧美视频在线| 欧美日韩中文精品| 一本到三区不卡视频| 成人免费高清视频| 成人激情午夜影院| 国产mv日韩mv欧美| 国产精品99精品久久免费| 精品一区二区免费视频| 丝袜脚交一区二区| 午夜国产不卡在线观看视频| 一区二区三区四区亚洲| 伊人开心综合网| 一区二区免费视频| 国产成人免费在线| 成人激情文学综合网| 久久99久久精品| 国产麻豆精品在线| 高清在线成人网| 91在线视频网址| 欧美午夜在线观看| 色播五月激情综合网| 欧美区视频在线观看| 日韩欧美亚洲一区二区| 欧美精品一区二区三区蜜臀| 2020国产精品| 一区二区三区电影在线播| 亚洲第一久久影院| 精品亚洲国产成人av制服丝袜| 激情五月婷婷综合| 91香蕉视频污在线| 91精品国产福利在线观看| 欧美精品一区二区三区蜜桃视频 | 国产女同性恋一区二区| 亚洲精品中文在线影院| 日韩av中文在线观看| 不卡av在线免费观看| 欧美精品乱码久久久久久| 久久亚洲私人国产精品va媚药| 亚洲美女电影在线| 国产高清不卡一区二区| 日韩一区二区在线看片| 亚洲一区成人在线| 成人免费高清视频| 欧美tk—视频vk| 午夜精品久久久久久不卡8050| av激情亚洲男人天堂| 国产三级精品三级| 久久国产综合精品| 欧美日韩mp4| 国产亲近乱来精品视频| 美女www一区二区| 日韩一区二区在线观看视频播放| 午夜精品123| 91精品国产综合久久福利软件| 亚洲尤物视频在线| 欧美撒尿777hd撒尿| 一区二区三区国产| 欧美三级中文字幕| 天天综合网 天天综合色| 欧美三级三级三级| 丝瓜av网站精品一区二区 | 风间由美中文字幕在线看视频国产欧美 | 欧美高清激情brazzers| 亚洲成人动漫在线免费观看| 欧美肥胖老妇做爰|