开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
main
分支 (2)
main
gh-pages
main
分支 (2)
main
gh-pages
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
main
分支 (2)
main
gh-pages
JSObject.java 6.23 KB
一键复制 编辑 原始数据 按行查看 历史
cxylk 提交于 2021年01月21日 16:33 +08:00 . :rainbow: idea构建jdk源码
/*
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package netscape.javascript;
import java.applet.Applet;
// FIXME: need URL on oracle.com for new LiveConnect spec
/**
* <P> Allows Java code to manipulate JavaScript objects. </P>
*
* <P> When a JavaScript object is passed or returned to Java code, it
* is wrapped in an instance of <CODE>JSObject</CODE>. When a
* <CODE>JSObject</CODE> instance is passed to the JavaScript engine,
* it is unwrapped back to its original JavaScript object. The
* <CODE>JSObject</CODE> class provides a way to invoke JavaScript
* methods and examine JavaScript properties. </P>
*
* <P> Any data returned from the JavaScript engine to Java is
* converted to Java data types. Certain data passed to the JavaScript
* engine is converted to JavaScript data types. See the section on <A
* HREF="https://jdk6.dev.java.net/plugin2/liveconnect/#JAVA_JS_CONVERSIONS">Data
* Type Conversions</A> in the <A
* HREF="https://jdk6.dev.java.net/plugin2/liveconnect/">new
* LiveConnect Specification</A> for details on how values are
* converted. </P>
*
*/
public abstract class JSObject {
/**
* Constructs a new JSObject. Users should not call this method
* nor subclass JSObject.
*/
protected JSObject() {
}
/**
* <p> Calls a JavaScript method. Equivalent to
* "this.methodName(args[0], args[1], ...)" in JavaScript.
* </p>
*
* @param methodName The name of the JavaScript method to be invoked.
* @param args the Java objects passed as arguments to the method.
* @return Result of the method.
*/
public abstract Object call(String methodName, Object... args) throws JSException;
/**
* <p> Evaluates a JavaScript expression. The expression is a string of
* JavaScript source code which will be evaluated in the context given by
* "this".
* </p>
*
* @param s The JavaScript expression.
* @return Result of the JavaScript evaluation.
*/
public abstract Object eval(String s) throws JSException;
/**
* <p> Retrieves a named member of a JavaScript object. Equivalent to
* "this.name" in JavaScript.
* </p>
*
* @param name The name of the JavaScript property to be accessed.
* @return The value of the propery.
*/
public abstract Object getMember(String name) throws JSException;
/**
* <p> Sets a named member of a JavaScript object. Equivalent to
* "this.name = value" in JavaScript.
* </p>
*
* @param name The name of the JavaScript property to be accessed.
* @param value The value of the propery.
*/
public abstract void setMember(String name, Object value) throws JSException;
/**
* <p> Removes a named member of a JavaScript object. Equivalent
* to "delete this.name" in JavaScript.
* </p>
*
* @param name The name of the JavaScript property to be removed.
*/
public abstract void removeMember(String name) throws JSException;
/**
* <p> Retrieves an indexed member of a JavaScript object. Equivalent to
* "this[index]" in JavaScript.
* </p>
*
* @param index The index of the array to be accessed.
* @return The value of the indexed member.
*/
public abstract Object getSlot(int index) throws JSException;
/**
* <p> Sets an indexed member of a JavaScript object. Equivalent to
* "this[index] = value" in JavaScript.
* </p>
*
* @param index The index of the array to be accessed.
*/
public abstract void setSlot(int index, Object value) throws JSException;
/**
* <p> Returns a JSObject for the window containing the given applet.
* </p>
*
* @param applet The applet.
* @return JSObject for the window containing the given applet.
*/
public static JSObject getWindow(Applet applet) throws JSException {
throw new JSException("Unexpected error: This method should not be used unless loaded from plugin.jar");
/*
try
{
if (applet != null)
{
String obj = (String) applet.getParameter("MAYSCRIPT");
// Comment out MAYSCRIPT check because Internet Explorer doesn't support
// it.
// if (obj != null && (obj.equals("") || (new Boolean(obj).booleanValue() == true)))
{
// MAYSCRIPT is enabled
AppletContext c = applet.getAppletContext();
// The applet context must implement the sun.plugin.javascript.JSContext
// in order for us to get the handle that can be used when evaluating
// JavaScript expression.
//
JSObject ret = null;
if (c instanceof sun.plugin.javascript.JSContext)
{
JSContext j = (JSContext) c;
ret = j.getJSObject();
}
if (ret != null) {
return ret;
}
}
} else {
// new code for CustomProgress to get the JSObject w/o applet
AppContext ac = ToolkitStore.get().getAppContext();
if (ac != null) {
Plugin2Context context = (Plugin2Context)
ac.get(sun.plugin2.applet.Plugin2Manager.APPCONTEXT_PLUGIN2CTX_KEY);
if (context != null) {
Applet2Host host = context.getHost();
if (host != null && host instanceof JSContext) {
JSContext jsc = (JSContext) host;
JSObject ret = jsc.getOneWayJSObject();
if (ret != null) {
return ret;
}
}
}
}
}
}
catch (Throwable e)
{
throw (JSException) new JSException(JSException.EXCEPTION_TYPE_ERROR, e).initCause(e);
}
throw new JSException();
*/
}
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

Java学习过程中遇到的知识点总结,复习笔记
暂无标签
Apache-2.0
使用 Apache-2.0 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cxylk/Java-Notes.git
git@gitee.com:cxylk/Java-Notes.git
cxylk
Java-Notes
Java-Notes
main
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /