这部分只是简单模拟Spring生成对象,例如spring -> context 扫描生成对象 生成指定包下面含有指定注解的类的对象 ,只包含部分功能,后续完善
自定义注解@Target(ElementType.TYPE)@Documented@Retention(RetentionPolicy.RUNTIME)public @interface MyCompoment { String value() default "";}
模拟的代码
package test.factory;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import test.anno.MyCompoment;
import test.anno.MyController;
import test.anno.MyDao;
import test.anno.MyService;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.*;
/**
* @program: workSet
* @description: test
* @author: Mylo
* @create: 2018-08-31 18:57
**/
public class Analyze {
//标签名 ---标签的内容 -> 属性名 属性的内容
private static Map<String , ArrayList<HashMap<String ,String>>> maps = new HashMap<>();
private static Map<String,Object> beanMaps = new HashMap<>();
自定义注解@Target(ElementType.TYPE)@Documented@Retention(RetentionPolicy.RUNTIME)public @interface MyCompoment { String value() default "";}
模拟的代码
package test.factory;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import test.anno.MyCompoment;
import test.anno.MyController;
import test.anno.MyDao;
import test.anno.MyService;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.*;
/**
* @program: workSet
* @description: test
* @author: Mylo
* @create: 2018-08-31 18:57
**/
public class Analyze {
//标签名 ---标签的内容 -> 属性名 属性的内容
private static Map<String , ArrayList<HashMap<String ,String>>> maps = new HashMap<>();
private static Map<String,Object> beanMaps = new HashMap<>();