1. GI的JS框架中也有类似Java的Reflect的特性,比如forName()方法。
2. GI的JS中也是单根继承, 可以实现多个接口。需要定义constructor,名字必须是init(). Class/Interface中可以定义成员方法, 静态方法和抽像方法,成员变量,静态变量.
例子在下面一断代码块里, 从GI的API里拷出来的。
/*
You may obtain an instance of jsx3.lang.Class in one of the following ways:
*/
var c = jsx3.Class.forName("jsx3.Object");
var c = jsx3.Object.jsxclass;
/*
This class is also used for defining classes. Use one of defineClass and defineInterface to define a class in the JSX class hierarchy. Note that any class defined in the package jsx3.lang is aliased into the jsx3 package. Therefore jsx3.lang.Object may also be referenced as jsx3.Object.
The following are class nomenclature definitions using jsx3.lang.Object as an example:
*/
/*
jsx3.lang — the package, an instance of (JavaScript, not JSX) Object
jsx3.lang.Object — the class constructor, instance of Function
jsx3.lang.Object.jsxclass — the class, instance of jsx3.lang.Class
jsx3.lang.Object.prototype — the class prototype, instance of Object
The following is an example of how to define a new class called Example in package eg:
*/
jsx3.lang.Class.defineClass(
"eg.Example", // the full name of the class to create
eg.Base, // the class extends eg.Base
[eg.Comparable, eg.Testable], // the class implements interfaces eg.Comparable and eg.Testable
function(Example) { // name the argument of this function "Example"
// every class must define an init method since it is called automatically by the constructor
Example.prototype.init = function(arg1) {
this.arg1 = arg1;
};
// define an instance method like this:
Example.prototype.instanceMethod = function() {
...
};
// define an abstract method like this:
Example.prototype.abstractMethod = jsx3.Method.newAbstract();
// define a static method like this:
Example.staticMethod = function() {
...
};
// define a static field like this:
Example.STATIC_FIELD = "...";
// define an instance field like this:
Example.prototype.instanceField = "...";
}
);
分享到:
相关推荐
在apache-maven-3.5.2/conf/setting.xml中加入以下配置即可解决 alimaven aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ central junit junit Address/ ...
idea创建Maven项目时,报错显示Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources,并且Maven插件内看不到 mybatis-generator。如下图: 折腾了好久发现配置放错地方了,...
为了满足这些玩家的需求,3DMods社区开发了一款名为GI-Model-Importer的工具,该工具专门用于将自定义的3D模型导入到原神游戏中,为玩家提供了自由定制游戏内角色和物体的可能性。 一、3D模型导入基础知识 在游戏...
资源分类:Python库 所属语言:Python 资源全名:vext.gi-0.5.6.22.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
安装oracle、gi、rac 时经常会碰到 pdksh包的检测失败,可直接下载相关压缩包,解压后,传到服务器直接安装使用即可。下载的zip包里面包含32位和64位。注意:请选择正确版本安装。由于现在相关rpm包比较难找,故传...
适用机芯:ZLS58Gi4X 固件版本:V2.00102 适用机型:请以机芯为准; 特点: 1、无开机广告 2、屏蔽升级 3、不限制应用安装 4、内置root权限 5、大量精简内置无用的软件 刷机方法: 复制下面的刷机文件:***.bin到U...
NFPP(Network Fine Packet Policy)是锐捷网络设备中的一项重要安全特性,主要用于防范常见的网络攻击,如ARP欺骗、IP欺骗等,从而保护网络设备的安全稳定运行。NFPP支持多种策略配置,包括基于端口的防护、基于MAC...
1.先确认电视机芯是否是表中所列,电视刷机机芯必须是此贴中所介绍的机芯。 2.将升级文件放入U盘时请注意U盘中只能存在一种升级文件,如存在2个或以上,则无法进行升级。 注意:中途不能拔插U盘和断电!以免变砖。 ...
ttpsgitee.comhuangyongsmart-framework.gi_smart-framework
长虹ZLS58GI机芯JUC.820.00141998-v4主板图纸.pdf 该文件为长虹ZLS58GI机芯JUC.820.00141998-v4主板图纸的PDF文件,包含了该主板的电路图和设计说明。下面是从该文件中提取的相关知识点: 1. DC-DC转换器设计:...
自定义一个插件,继承AbstractMojo,实现execute方法,引入该自定义插件,执行mvn install,报错 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default ...
概述:在浏览器中识别来自任何网站的任何音乐。 安装 AudD 扩展并单击其图标以识别当前选项卡上正在播放的歌曲。 观看上面的视频,了解它是如何工作的。 描述: 在浏览器中识别来自任何网站的任何音乐。 安装AudD...
情景:从项目中拿到一个客户的demo工程,或者导入一个别人的工程,编译时出现 Error:No such property: GradleVersion for class: JetGradlePlugin: 原因:这是gradle的版本太高导致的 解决办法: 第一步:打开...
《Yu-Gi-Oh! 贸易卡》是一款基于著名动画《游戏王》(Yu-Gi-Oh!) 的集换式卡牌游戏。在这个游戏中,玩家通过收集、交换卡牌来构建自己的卡组,然后与其他玩家进行对决,利用策略和技巧来赢得比赛。JavaScript 是实现...
银河麒麟系统桌面版4.0.2,初始化hidapi,所需依赖库libusb-1.0-0-dev_1.0.20-1kord_arm64.deb
/** * 对Date的扩展,将 Date 转化为指定格式的String * 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符 ...\)\//gi, "new Date($1)"))).pattern("yyyy-M-d h:m:s.S");
npm-merge-driver(1)-用于自动合并锁文件的git merge驱动程序自动设置(推荐): 要立即开始使用它: $ npx npm-merge-driver install --global或按项目在本地安装: $ cd /path/to/git/repository$ npx npm-merge...
Python3.6的bz2模块需要的so文件,可复制到lib/python3.6/lib-dynload使用
在SAP MM模块中,事务代码是用于执行特定业务流程的关键命令。以下是对标题和描述中涉及的一些关键事务代码的详细解释: 1. **采购订单**: - ME21N:创建采购订单,适用于已知供应商的情况。在这个事务代码中,...
配置AWS凭证和区域环境变量以在其他GitHub操作中使用。 AWS开发工具包和AWS CLI都将检测到环境变量,以确定用于AWS API调用的凭据和区域。 目录 用法 将以下步骤添加到您的工作流程中: - name : Configure AWS ...