1
1
/*
2
- * Copyright 2002-2012 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -120,12 +120,14 @@ protected Class<?> getBeanClass(Element element) {
120
120
121
121
@ Override
122
122
protected void doParse (Element element , ParserContext parserContext , BeanDefinitionBuilder builder ) {
123
- String listClass = element .getAttribute ("list-class" );
124
123
List <Object > parsedList = parserContext .getDelegate ().parseListElement (element , builder .getRawBeanDefinition ());
125
124
builder .addPropertyValue ("sourceList" , parsedList );
125
+
126
+ String listClass = element .getAttribute ("list-class" );
126
127
if (StringUtils .hasText (listClass )) {
127
128
builder .addPropertyValue ("targetListClass" , listClass );
128
129
}
130
+
129
131
String scope = element .getAttribute (SCOPE_ATTRIBUTE );
130
132
if (StringUtils .hasLength (scope )) {
131
133
builder .setScope (scope );
@@ -143,12 +145,14 @@ protected Class<?> getBeanClass(Element element) {
143
145
144
146
@ Override
145
147
protected void doParse (Element element , ParserContext parserContext , BeanDefinitionBuilder builder ) {
146
- String setClass = element .getAttribute ("set-class" );
147
148
Set <Object > parsedSet = parserContext .getDelegate ().parseSetElement (element , builder .getRawBeanDefinition ());
148
149
builder .addPropertyValue ("sourceSet" , parsedSet );
150
+
151
+ String setClass = element .getAttribute ("set-class" );
149
152
if (StringUtils .hasText (setClass )) {
150
153
builder .addPropertyValue ("targetSetClass" , setClass );
151
154
}
155
+
152
156
String scope = element .getAttribute (SCOPE_ATTRIBUTE );
153
157
if (StringUtils .hasLength (scope )) {
154
158
builder .setScope (scope );
@@ -166,12 +170,14 @@ protected Class<?> getBeanClass(Element element) {
166
170
167
171
@ Override
168
172
protected void doParse (Element element , ParserContext parserContext , BeanDefinitionBuilder builder ) {
169
- String mapClass = element .getAttribute ("map-class" );
170
173
Map <Object , Object > parsedMap = parserContext .getDelegate ().parseMapElement (element , builder .getRawBeanDefinition ());
171
174
builder .addPropertyValue ("sourceMap" , parsedMap );
175
+
176
+ String mapClass = element .getAttribute ("map-class" );
172
177
if (StringUtils .hasText (mapClass )) {
173
178
builder .addPropertyValue ("targetMapClass" , mapClass );
174
179
}
180
+
175
181
String scope = element .getAttribute (SCOPE_ATTRIBUTE );
176
182
if (StringUtils .hasLength (scope )) {
177
183
builder .setScope (scope );
@@ -180,23 +186,30 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
180
186
}
181
187
182
188
183
- private static class PropertiesBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
189
+ private static class PropertiesBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
184
190
185
191
@ Override
186
192
protected Class <?> getBeanClass (Element element ) {
187
193
return PropertiesFactoryBean .class ;
188
194
}
189
195
190
- @ Override
191
- protected boolean isEligibleAttribute (String attributeName ) {
192
- return super .isEligibleAttribute (attributeName ) && !SCOPE_ATTRIBUTE .equals (attributeName );
193
- }
194
-
195
196
@ Override
196
197
protected void doParse (Element element , ParserContext parserContext , BeanDefinitionBuilder builder ) {
197
- super .doParse (element , parserContext , builder );
198
198
Properties parsedProps = parserContext .getDelegate ().parsePropsElement (element );
199
199
builder .addPropertyValue ("properties" , parsedProps );
200
+
201
+ String location = element .getAttribute ("location" );
202
+ if (StringUtils .hasLength (location )) {
203
+ String [] locations = StringUtils .commaDelimitedListToStringArray (location );
204
+ builder .addPropertyValue ("locations" , locations );
205
+ }
206
+
207
+ builder .addPropertyValue ("ignoreResourceNotFound" ,
208
+ Boolean .valueOf (element .getAttribute ("ignore-resource-not-found" )));
209
+
210
+ builder .addPropertyValue ("localOverride" ,
211
+ Boolean .valueOf (element .getAttribute ("local-override" )));
212
+
200
213
String scope = element .getAttribute (SCOPE_ATTRIBUTE );
201
214
if (StringUtils .hasLength (scope )) {
202
215
builder .setScope (scope );
0 commit comments