- problem description
I am writing a framework, but the main function is that the lower computer communicates with the host computer in a protocol similar to json, both sides can flexibly find fields through several index tables (for example, this string of binary data describes a business model, and I need to parse this string of binary data into a Java object). For the flexibility of the framework, I want to imitate WebMvcConfigurerAdapter
in Spring, but now I have encountered a problem. The things I wrote are very complicated, so I won"t post them. I would like to ask for help from all kinds of gods.
you can reference the spring framework
this configuration is similar to the following
@Configuration
public class MyWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {
/**
*
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/my/**").addResourceLocations("classpath:/my/");
super.addResourceHandlers(registry);
}
}
- final destination
@Configuration
public class ProtocolIndexConfigurerAdapterImpl extends ProtocolIndexConfigurerAdapter {
/**
*
* @param registry
*/
@Override
public void addIndex(ProtocolIndexRegistry registry) {
// 0001
register.addTypeIndex("0001").register("id");
register.addTypeIndex("0002").register("name");
}
}