首页
社区
课程
招聘
[分享][JAVA] Reflection - The Java Reflection API
发表于: 2011-2-2 07:00 4412

[分享][JAVA] Reflection - The Java Reflection API

2011-2-2 07:00
4412
Reflection - The Java Reflection API

[left]With the introduction of Java Beans was also the birth of Reflection (formerly " Introspection ")
forced initiated because objects were previously found only in static structures. This in turn
meantthat the classes had already at compile be available. Because of this fact but the genericapplication
form request can not be extended to the interface of a plugin, corresponded, it wasdecided to introduce
a new technique? Introspection (later Reflection ).
The term Reflection here means that programs which are a generic design to be able put in for herclasses
(unknown such as by direct user input) to create instances of objects. The Reflection APIincludes the
following features:
Determine the class of an object
Details of Klassenmodifikatoren, members, methods, constructors, and superclasses get.
Get out what constants and method declarations belong to an interface.
Creating an instance of a class known until runtime.
Reading and setting of values of a member even if the member is known by name at run time.
Calling methods of an unknown object at runtime.
Generation of arrays, the size and type until run time are not known and modifications to theindividual array components.

Contents
1
Investigation of classes
1.1
Querying the Class object
2.1
Query the class name
1.3
Finding of Klassenmodifikatoren
4.1
superclasses identify
1.5
Identification of implemented interfaces
1.6
classes for their members (Fields) analyze
1.7
constructors of a class determine
1.8
The methods of a class representing
2
objects manipulated
2.1 Position the
object generation
2.1.1
Creating objects using parameterless constructors
2.1.2
Creating objects using parameterized constructors
2.2 Value
of members read
2.3
Values of members and share
2.4
Calling methods
3 Using
Arrays
3.1 Identification
of arrays
3.2 To identify
the array type
3.3
arrays produce read, and fill
4
Summary of all the reflection classesInvestigation[/left]

REFLECTION

reflect

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

上传的附件:
收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//