[spring-extensions] branch master updated: JES-29 Move listification to after property replacement.

Ian Young ian at iay.org.uk
Tue Aug 28 06:50:49 EDT 2018


This is an automated email from the git hooks/post-receive script.

iay pushed a commit to branch master
in repository spring-extensions.

View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=91410d951effc9bc137a46763e967f694fff4706

The following commit(s) were added to refs/heads/master by this push:
       new  91410d9   JES-29 Move listification to after property replacement.
91410d9 is described below

commit 91410d951effc9bc137a46763e967f694fff4706
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