Allow other delimiters in profile XML attribute

Previously, only commas could delimit <beans profile="p1,p2"/>.  Now, as
with <bean alias="..."/>, the profile attribute allows for delimiting
by comma, space and/or semicolon.

BeanDefinitionParserDelegate.MULTI_VALUE_ATTRIBUTE_DELIMITERS has been
added as a constant to reflect the fact this set of delimiters is used
in multiple locations throughout the framework.
BDPD.BEAN_NAME_DELIMITERS now refers to the above and has been has been
preserved but deprecated for backward compat (though use outside the
framework is unlikely).

Changes originally based on user comment at
http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/comment-page-1/#comment-184455

Issue: SPR-8033
This commit is contained in:
Chris Beams
2011-03-11 04:08:10 +00:00
parent b5baa69f5d
commit f17f970144
5 changed files with 30 additions and 12 deletions

View File

@@ -82,11 +82,12 @@
<xsd:attribute name="profile" use="optional" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
The set of profiles for which this <beans> element may be parsed. May be a comma-delimited
list in the case of multiple profiles. If one or more of the specified profiles are active at time
of parsing, the <beans> element will be parsed, and all of its <bean> elements registered,
&lt;import&gt; elements followed, etc. If none of the specified profiles are active at time of parsing,
then the entire element and its contents will be ignored.
The set of profiles for which this <beans> element may be parsed. Multiple profiles can be
separated by any number of spaces, commas, or semi-colons (or indeed any mixture of the three).
If one or more of the specified profiles are active at time of parsing, the <beans> element
will be parsed, and all of its <bean> elements registered, &lt;import&gt; elements followed,
etc. If none of the specified profiles are active at time of parsing, then the entire element
and its contents will be ignored.
Profiles are activated in one of two ways:
Programmatic: