io.github.yangyouwang.core.ControllerWrapper Maven / Gradle / Ivy
package io.github.yangyouwang.core;
import io.github.yangyouwang.annotion.Wrapper;
import io.github.yangyouwang.consts.ConfigConsts;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Wrapper包装类
*
* @author yangyouwang
*/
@Component
public class ControllerWrapper {
private static ControllerWrapper instance;
private ControllerWrapper(){}
public static ControllerWrapper getInstance() {
if (instance == null) {
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
instance = (ControllerWrapper) applicationContext.getBean("controllerWrapper");
}
return instance;
}
public List