标签:字段 details nfa 函数 AC hello 除了 welcome 传统
1 <bean id="tracing" class="brave.spring.beans.TracingFactoryBean"> 2 ... 3 <property name="propagationFactory"> 4 <bean id="propagationFactory" class="brave.propagation.ExtraFieldPropagation" 5 factory-method="newFactory"> 6 <constructor-arg index="0"> 7 <util:constant static-field="brave.propagation.B3Propagation.FACTORY" /> 8 </constructor-arg> 9 <constructor-arg index="1"> 10 <list> 11 <value>user-name</value> 12 </list> 13 </constructor-arg> 14 </bean> 15 </property> 16 </bean>
1 <bean id="carFactory" class="com.home.factoryMethod.CarInstanceFactory"> 2 ... 3 </bean> 4 <bean id="car4" factory-bean="carFactory" factory-method="getCar"> 5 <constructor-arg value="4"></constructor-arg> 6 </bean>
1 ApplicationContext ctx = new ClassPathXmlApplicationContext("bean-factoryMethod.xml"); 2 Car car1 = (Car) ctx.getBean("car4");
1 <constructor-arg index="0"> 2 <util:constant static-field="brave.propagation.B3Propagation.FACTORY" /> 3 </constructor-arg>
1 <bean id="some1" class="cn.itcast.spring._util.Some"> 2 <property name="val" value="some instance1" /> 3 </bean> 4 <bean id="some2" class="cn.itcast.spring._util.Some"> 5 <property name="val" value="some instance2" /> 6 </bean> 7 <bean id="some3" class="cn.itcast.spring._util.Some"> 8 <property name="val" value="some instance3" /> 9 </bean> 10 <util:list id="strArray"> 11 <value>Hello</value> 12 <value>Welcome</value> 13 </util:list> 14 <util:list id="objArray"> 15 <ref bean="some1" /> 16 <ref bean="some2" /> 17 <ref bean="some3" /> 18 </util:list> 19 <util:list id="list" list-class="java.util.ArrayList"> 20 <ref bean="some1"/> 21 <ref bean="some2" /> 22 <ref bean="some3" /> 23 </util:list> 24 <util:map id="map" map-class="java.util.HashMap" > 25 <entry key="key1" value-ref="some1"/> 26 <entry key="key2" value-ref="some2"/> 27 <entry key="key3" value-ref="some3"/> 28 </util:map> 29 <bean id="someBean" class="cn.itcast.spring._util.SomeBean"> 30 <property name="someStrArray" ref="strArray"/> 31 <property name="someObjArray" ref="objArray"/> 32 <property name="someList" ref="list"/> 33 <property name="someMap" ref="map"/> 34 </bean>
标签:字段 details nfa 函数 AC hello 除了 welcome 传统
原文地址:https://www.cnblogs.com/xiashiwendao/p/8971545.html