MarsValue 注解
你可以将需要配置的值放在配置文件中,如下
- @Override
- public Map
marsValues() { Map map = new HashMap (); map.put("a","123"); map.put("b.c","456"); map.put("e.f.g","789"); return map; }
然后在你的MarsBean的属性上加MarsValue注解,即可注入
- @MarsValue("a")
- private String a;
- @MarsValue("b.c")
- private String bc;
- @MarsValue("e.f.g")
- private String efg;
属性名称可以按照你的需求任意命名,注解内的参数必须是示例中的写法