Jump to content
Tuts 4 You

[JAVA] Reflection - The Java Reflection API


sirp

Recommended Posts

Posted

Reflection - The Java Reflection API

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

REFLECTION

reflect

Posted

Material from the first line

thanks for sharing

:thumbsup:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...