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