据我所知,该abstract
属性并不意味着在运行时用属性值替换。abstract
指示是否<bean>
应将声明用作模板。例如,你可以有这个
<bean abstract="true">
<property name="someField" value="some value" />
</bean>
如果 的值abstract
在运行时以某种方式设置为false
,Spring 将尝试为没有属性的<bean>
声明创建一个 bean。class
它会创造什么?
另请注意,在beans
XSD 中,abstract
属性的类型为xsd:boolean
<xsd:attribute name="abstract" type="xsd:boolean">
<xsd:annotation>-<xsd:documentation>
<![CDATA[ Is this bean "abstract", that is, not meant to be instantiated itself but rather just serving as parent for concrete child bean definitions? The default is "false". Specify "true" to tell the bean factory to not try to instantiate that particular bean in any case. Note: This attribute will not be inherited by child bean definitions. Hence, it needs to be specified per abstract bean definition. ]]>
</xsd:documentation>
</xsd:annotation></xsd:attribute>