[spring-extensions] branch maint-5 updated: JES-29 Move listification to after property replacement.
Rod Widdowson
rdw at steadingsoftware.com
Tue Aug 21 09:40:51 EDT 2018
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch maint-5
in repository spring-extensions.
View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=b3c33c5f0eb7c01f6a19b23cc81f27fcd8c24deb
The following commit(s) were added to refs/heads/maint-5 by this push:
new b3c33c5 JES-29 Move listification to after property replacement.
b3c33c5 is described below
commit b3c33c5f0eb7c01f6a19b23cc81f27fcd8c24deb
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Aug 21 14:34:05 2018 +0100
JES-29 Move listification to after property replacement.
https://issues.shibboleth.net/jira/browse/JSE-29
---
.../shibboleth/ext/spring/util/SpringSupport.java | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/main/java/net/shibboleth/ext/spring/util/SpringSupport.java b/src/main/java/net/shibboleth/ext/spring/util/SpringSupport.java
index ac034d1..513717e 100644
--- a/src/main/java/net/shibboleth/ext/spring/util/SpringSupport.java
+++ b/src/main/java/net/shibboleth/ext/spring/util/SpringSupport.java
@@ -48,6 +48,8 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.ParserContext;
@@ -271,15 +273,30 @@ public final class SpringSupport {
* Gets the value of a list-type attribute as a {@link ManagedList}.
*
* @param attribute attribute whose value will be turned into a list
- *
+ * @deprecated - use {@link #getAttributeValueAsList(Attr)}
* @return list of values, never null
*/
- @Nonnull public static ManagedList<String> getAttributeValueAsManagedList(@Nullable final Attr attribute) {
+ @Nonnull @Deprecated public static ManagedList<String>
+ getAttributeValueAsManagedList(@Nullable final Attr attribute) {
final List<String> valuesAsList = AttributeSupport.getAttributeValueAsList(attribute);
final ManagedList<String> managedList = new ManagedList<>(valuesAsList.size());
managedList.addAll(valuesAsList);
return managedList;
}
+
+ /**
+ * Gets the value of a list-type attribute as a {@link BeanDefinitionBuilder}.
+ *
+ * @param attribute attribute whose value will be turned into a list
+ * @return a bean which will generate a list of the values.
+ */
+ @Nonnull public static AbstractBeanDefinition getAttributeValueAsList(@Nullable final Attr attribute) {
+ final BeanDefinitionBuilder result =
+ BeanDefinitionBuilder.rootBeanDefinition(StringSupport.class, "stringToList");
+ result.addConstructorArgValue(attribute.getValue());
+ result.addConstructorArgValue(XMLConstants.LIST_DELIMITERS);
+ return result.getBeanDefinition();
+ }
/**
* Gets the text content of a list of {@link Element}s as a {@link ManagedList}.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list