新增xml模板文件

master
星期八 4 years ago
parent 9612b8279a
commit 9520ccf38c
  1. 3
      panda-beans/src/main/java/org/panda/beans/factory/impl/XmlBeanFactory.java
  2. 7
      panda-beans/src/main/resources/application.xml
  3. 25
      panda-beans/src/main/resources/application.xsd

@ -13,8 +13,11 @@ public class XmlBeanFactory implements BeanFactory {
Map<String,Object> beanMap = new HashMap<>(); Map<String,Object> beanMap = new HashMap<>();
public XmlBeanFactory(String resources){
}
@Override @Override
public Object getBean(String name) { public Object getBean(String name) {
return beanMap.get(name); return beanMap.get(name);

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<beans xmlns="" >
<bean id = "" class ="">
<propter id="" ref="" value=""></propter>
</bean>
</beans>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="beans" type="beansType"/>
<xs:complexType name="propterType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="id"/>
<xs:attribute type="xs:string" name="ref"/>
<xs:attribute type="xs:string" name="value"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="beanType">
<xs:sequence>
<xs:element type="propterType" name="propter"/>
</xs:sequence>
<xs:attribute type="xs:string" name="id"/>
<xs:attribute type="xs:string" name="class"/>
</xs:complexType>
<xs:complexType name="beansType">
<xs:sequence>
<xs:element type="beanType" name="bean"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Loading…
Cancel
Save