[spring-extensions] branch master updated: Add lazy-init versions of custom parsing methods.
Scott Cantor
cantor.2 at osu.edu
Fri Apr 26 10:17:58 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor 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=d8b8519c494666cebb3e4f5d9cca8e21de499cab
The following commit(s) were added to refs/heads/master by this push:
new d8b8519 Add lazy-init versions of custom parsing methods.
d8b8519 is described below
commit d8b8519c494666cebb3e4f5d9cca8e21de499cab
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Apr 26 10:17:50 2019 -0400
Add lazy-init versions of custom parsing methods.
---
.../shibboleth/ext/spring/util/SpringSupport.java | 49 +++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
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 d320314..cca7fb0 100644
--- a/src/main/java/net/shibboleth/ext/spring/util/SpringSupport.java
+++ b/src/main/java/net/shibboleth/ext/spring/util/SpringSupport.java
@@ -75,7 +75,6 @@ public final class SpringSupport {
*
* @return list of bean definitions
*/
- // TODO better javadoc, annotations
@Nullable public static ManagedList<BeanDefinition> parseCustomElements(
@Nullable @NonnullElements final Collection<Element> elements, @Nonnull final ParserContext parserContext) {
if (elements == null) {
@@ -91,6 +90,33 @@ public final class SpringSupport {
return definitions;
}
+
+ /**
+ * Parse list of elements into bean definitions and set the lazy-init flag.
+ *
+ * @param elements list of elements to parse
+ * @param parserContext current parsing context
+ *
+ * @return list of bean definitions
+ *
+ * @since 6.0.0
+ */
+ @Nullable public static ManagedList<BeanDefinition> parseLazyInitCustomElements(
+ @Nullable @NonnullElements final Collection<Element> elements, @Nonnull final ParserContext parserContext) {
+ if (elements == null) {
+ return null;
+ }
+
+ final ManagedList<BeanDefinition> definitions = new ManagedList<>(elements.size());
+ for (final Element e : elements) {
+ if (e != null) {
+ definitions.add(parseLazyInitCustomElement(e, parserContext));
+ }
+ }
+
+ return definitions;
+ }
+
/**
* Parse an element into a bean definition.
@@ -110,6 +136,27 @@ public final class SpringSupport {
}
/**
+ * Parse an element into a bean definition and set the lazy-init flag.
+ *
+ * @param element the element to parse
+ * @param parserContext current parsing context
+ *
+ * @return the parsed bean definition
+ *
+ * @since 6.0.0
+ */
+ @Nullable public static BeanDefinition parseLazyInitCustomElement(@Nullable final Element element,
+ @Nonnull final ParserContext parserContext) {
+ if (element == null) {
+ return null;
+ }
+
+ final BeanDefinition def = parserContext.getDelegate().parseCustomElement(element);
+ def.setLazyInit(true);
+ return def;
+ }
+
+ /**
* Parse the provided Element into the provided registry.
*
* @param springBeans the element to parse
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list