Fly 115 micro-chip resources to see the signal you know

Look fly 115 micro-chip resources you know gamma signal V core 79601048█
reflection

notes

reflection: the soul of design framework
* Framework: Semi-finished software. Software can be developed on the base frame, to simplify the coding
* reflector: The various components of the package as the other objects of the class, which is the reflection
* advantages:
1. Can run the process, the operation of these objects.
2. Decoupling can improve program scalability.
. 1
2
. 3
. 4
. 5
* Get Class object ways:
1. the Class.forName ( "full class name"): the bytecode file loaded into memory, the object return Class
* used for the configuration file, the class name is defined in the configuration file in. Reading the file, loading the class
2. Class name .class: property class obtained by class name
* used for passing parameters
3. Object .getClass (): getClass () methods defined in the class Object.
* Get bytecode way for multi-object

* Conclusion: The
same bytecode files (* .class) during a program is running, it will only be loaded once, regardless of which way acquired by Class objects are the same one.


* Class Object features:
* acquisition function:
1. Obtain the member variables are
* Field [] getFields (): Gets all public member variables modified
* Field getField (String name) get modified public member variables specified name

* Field [] getDeclaredFields () Gets all member variables, regardless of modifiers
* Field, getDeclaredField (String name)
2. Gets constructor who
* Constructor <? > [] getConstructors ()
* Constructor <T> getConstructor (class <?> ... parameterTypes)

* Constructor <T> getDeclaredConstructor (class <?> ... parameterTypes)
* Constructor <?> [] getDeclaredConstructors ()
3. The method of obtaining the members are:
* method, [] getMethods ()
* method, getMethod (<?> String name, class ... parameterTypes)

* method, [] getDeclaredMethods ()
<?> * method, getDeclaredMethod (String name, class ... parameterTypes )

4. Get the full class name
* String getName ()


* Field,: member variables
* operation:
1. set value
The SET void * (Object obj, Object value)
2. Gets the value
* GET (Object obj)

3. ignored safety inspection access modifier
* setAccessible (true): Violence reflection



* Constructor: Constructor
* Create an object:
* T newInstance (object ... the supplied initargs)

* If the object is created with an empty argument constructor, the operation can be simplified: newInstance method Class object


* method: method object
* execution method:
* Invoke object (object obj, args object ...)

* Get method name:
* String getName: Gets the method name

tricky to see the film you understand the micro signal resources

Guess you like

Origin www.cnblogs.com/tingyan999/p/12436165.html