Reflection in Java

Source: Internet
Author: User

1: The concept of reflection

Reflection refers to a class of applications that are self-describing and self-controlling. In other words, this kind of application uses some mechanism to realize the description (self-representation) and monitoring (examination) of its own behavior, and can adjust or modify the state and related semantics of the behavior described by the application according to the state and result of its behavior.

2: The effect of the reflection

It can be said that the system that realizes the reflection mechanism is open, but the system with openness does not necessarily adopt the reflection mechanism, and openness is the necessary condition of the reflective system. In general, the reflective system must satisfy the causal connection (causally-connected) In addition to the open conditions. The so-called causal connection refers to the fact that the self-describing changes of the reflective system can be immediately reflected in the actual state and behavior of the system, and vice versa. Openness and causal connection are two basic elements of reflective systems.

3: class in the reflection mechanism:

Java.lang.Class;

Java.lang.reflect.Constructor;

Java.lang.reflect.Field;

Java.lang.reflect.Method;

Java.lang.reflect.Modifier;

4: Specific Function realization

  

Reflection in Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.