Chapter 16 Reflections and Annotations

Through the Java reflection mechanism, you can access the description of the Java object that has been loaded into the JVM in the program, and realize the function of accessing, detecting and modifying the information describing the Java object itself. The Java reflection mechanism is very powerful, and support for this function is provided in […]

BGP route reflector experiment example

1. Understanding route reflectors: To ensure connectivity between IBGP peers, a full connection relationship needs to be established between IBGP peers. Assuming that there are n devices within an AS, the number of IBGP connections established is n(n-1)/2. When there are a large number of devices, the device configuration will be very complicated, and the […]

[Data structure] Reflection, enumeration

?Author: Xiao Hu_Bu Muzhu Author’s homepage: Xiao Hu_Bumuzzled’s personal homepage Included column: A brief discussion of data structure Continue to update articles and follow bloggers to avoid detours. Thank you for your support Reflection, enumeration 1. Reflection 1.1 Definition 1.2 Reflection related classes 1.3 Reflection example 1.3.1 Three ways to obtain Class objects 1.3 Reflection […]

Use reflection to dynamically construct wrapper conditions (use reflection to obtain annotation values and entity class values)

Use reflection to dynamically construct wrapper conditions Entity class /** * api list query entity class * *@authorwys */ @Data public class SysApiQuery { private Long id; /** * api name */ @Query(type = QueryTypeEnum.EQUAL) private String apiName; /** * api path */ @Query(type = QueryTypeEnum.EQUAL) private String apiUrl; /** Starting time */ @JsonIgnore private […]

JAVA reflection mechanism implements methods of calling classes

NmsMonitorDrillController package com.nrxt.nms.mon.ms.controller; import com.nrxt.nms.mon.ms.service.impl.NmsMonitorDrillService; import com.nrxt.nms.mon.ms.utils.ByteArrayUtil; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Controller @RequestMapping(value = “/monitor/interface”) public class NmsMonitorDrillController { @Resource NmsMonitorDrillService nmsMonitorDrillService; private static final Logger logger = Logger.getLogger(NmsMonitorDrillController.class); @ResponseBody @RequestMapping(value = “/queryByDrillReceive”, method = RequestMethod.POST) public byte[] queryByDrillReceive(HttpServletRequest […]

BindingFlags in C#: Core enumeration types for reflection

The C# programming language provides a very powerful feature: reflection, which allows us to dynamically obtain and operate type information at runtime. Reflection can be used to implement many advanced functions, such as dynamically loading assemblies, creating object instances, calling methods, accessing fields and properties, etc. To use reflection, we need to use some classes […]

Java advanced unit testing and reflection

1. Junit testing tool @Test defines test method 1. Methods marked with @BeforeClass are executed before all methods 2. Methods marked with @AfterCalss are executed after all methods 3. Methods marked with @Before are executed before each @Test method 4. Methods marked with @After are executed after each @Test method public class StringUtilTest{ @Before public […]

Basic understanding and use of reflection

Reflection is the soul of frame design 1. Overview of reflection The JAVA reflection mechanism is that in the running state, for any class, you can know all the properties and methods of this class; for any object, you can call any of its methods and properties; this dynamically obtained information and dynamic calls The […]

Unit testing & reflection & annotations

Unit testing It is to write test code to test the correctness of the smallest functional unit (method). How did we perform unit testing before? What’s the problem? Junit unit testing framework It can be used to test methods. It is open sourced by Junit. Specific steps Common annotations of Junit framework public class StringUtilTest […]