Introduction
For maximum efficiency, GWT compiles your Java source into a monolithic
script. Now gwt-ent provide a reflection implement by gwt code generator
mechanism.
This Framework support
- Class http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/src/main/java/com/gwtent/reflection/client/ClassType.java
- Field http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/src/main/java/com/gwtent/reflection/client/Field.java
- Method http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/src/main/java/com/gwtent/reflection/client/Method.java
- Constructor http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/src/main/java/com/gwtent/reflection/client/Constructor.java
- Metedata http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/src/main/java/com/gwtent/reflection/client/HasMetaData.java
- Annotation http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/src/main/java/com/gwtent/reflection/client/HasAnnotations.java
How to use
# add Annotation Or Reflection Marker interface into your pojo class
@Reflectable
public class TestReflection{
}
public class TestReflection implements Reflection{
}
@Reflect_Domain
public class TestReflection{
}
# get ClassType.
ClassType classType = TypeOracle.Instance.getClassType(TestReflection.class);
For example:
public void testReflection(){
TestReflection test = new TestReflection();
ClassType classType = TypeOracle.Instance.getClassType(TestReflection.class);
test.setString("set by code");
System.out.println("after SetByCode:" + test.getString());
System.out.println("after SetByCode:" + classType.invoke(test, "getString", null));
classType.invoke(test, "setString", new Object[]{"set by invoke"});
System.out.println("after SetByInvoke:" + classType.invoke(test, "getString", null));
}
}
The output is :
after SetByCode:set by code
after SetByCode:set by code
after SetByInvoke:set by invoke
Control you javascript size
GWTENT provide you more power to control how much reflection information
created.
The Class Scope
You can control whether have:
- Class Annotation
- Fields
- Methods
- Constructors
- Field and Method Annotations
- Relation Types(The field type, the return type of method, the type of
Parameters)
- Super Classes ( all the super classes of this class will generate reflection
information)
- Assignable Classes (all assignable classes. if annotate to a class, this is
mean All subClasses will generate reflection information; if annotate to a
interface, then all implement classes will generate reflection information; if
annotate to an annotation, then all types annotated by this annotation will
generate reflection information)
Click Here For more Information
The Field/Method Scope
You can control whether have:
- Annotations
- Field Type
- Method Return Type
- Method Parameter Type
Click Here For more Information
The TestCase
ReflectionTestCase
Understand Reflection Classes
http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/src/main/java/com/gwtent/reflection/client/
分享到:
相关推荐
NULL 博文链接:https://littie1987.iteye.com/blog/1750383
NULL 博文链接:https://zkf60553.iteye.com/blog/1315760
gwt 练习gwt 练习gwt 练习gwt 练习
Gwt中文手册,GWt入门Gwt中文手册,GWt入门Gwt中文手册,GWt入门
EXT-GWT2.0.1+API+DOC gwtdesigner Gwt-Ext基础-中级-进阶 GWT快速开发 GWT入门 GWT中文教程
fwefwefwGWT工具GWT工具GWT工具GWT工具GWT工具GWT工具
gwt 入门,是你开始学习gwt的大道 安装之后的目录结构为: C:\程序开发\Java\gwt-windows-1.4.59 doc(文档目录,开发文档和Java API文档) samples(示例代码目录,非常有名的KitchenSink示例代码即在此目录中)...
GWT(Google Web Toolkit) 是 Google 最近推出的一个开发 Ajax 应用的框架,它支持用 Java 开发和调试 Ajax 应用,本文主要介绍如何利用 GWT 进行 Ajax 的开发。 Ajax技术是当前开发web应用的非常热门的技术,也是Web...
很好的资源,在这边分享下,提供给想要寻找GWT资源的兄弟姐妹们 如果哪位兄弟有好的资源不要忘了分享啊
2. Hello GWT 3. 模块 4. JSNI 5. 在GWT中使用XML 6. GWT控件详解 7. 使用GWT控件 8. GWT-RPC 9. Ext GWT 10. (实战)俄罗斯方块游戏 11. (实战)费用申请审批流程 12. GWT与Flex整合 13. 图片缓存 CSS Sprite 14. ...
smartgwt最新版本GWT的DEMO 谷歌web工具箱实例
用Maven创建GWT_SmartGWT项目,从而可利用Maven进行管理,以及持续集成。
GWT的eclipse4.4离线开发插件,国内现在没有
GWT学习时的一些小例子,和大家分享,GWT学习时的一些小例子,和大家分享
基本概念及GWT结构及命令,开发等的介绍
这个文件是关于GWT开发的,属于入门级别的,GWT新手可以下载了看看。
gwt学习资料 java gwt相关学习网站 gwt图解 gwt教学 gwt安装部署 步骤流程
gwt-2.1.0
最新火狐浏览器GWT开发插件,离线安装。不用在线等待!
GWT-Ext 控件演示 GWT-Ext 控件演示