[java-identity-provider] 01/04: IDP-1429 The PatternFactoryBean has moved to SpringSupport

Rod Widdowson rdw at steadingsoftware.com
Thu Apr 11 11:19:38 EDT 2019


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

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=23f48868e060b1b3a95cb920d3caee18ca99fb57

commit 23f48868e060b1b3a95cb920d3caee18ca99fb57
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Apr 11 14:59:34 2019 +0100

    IDP-1429 The PatternFactoryBean has moved to SpringSupport
    
    https://issues.shibboleth.net/jira/browse/IDP-1429
---
 .../resolver/spring/ad/PatternFactoryBean.java     | 91 ----------------------
 .../impl/RegexSplitAttributeDefinitionParser.java  |  2 +-
 2 files changed, 1 insertion(+), 92 deletions(-)

diff --git a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/PatternFactoryBean.java b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/PatternFactoryBean.java
deleted file mode 100644
index d96c28f..0000000
--- a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/PatternFactoryBean.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.resolver.spring.ad;
-
-import java.util.regex.Pattern;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.shibboleth.ext.spring.factory.AbstractComponentAwareFactoryBean;
-import net.shibboleth.utilities.java.support.logic.Constraint;
-
-/**
- * Factory bean for {@link Pattern}. Allows us to inject property based case sensitivity.
- */
-public class PatternFactoryBean extends AbstractComponentAwareFactoryBean<Pattern> {
-
-    /** Whether the we are case sensitive or not. */
-    @Nullable private Boolean caseSensitive;
-
-    /** The regular expressions. */
-    @Nullable private String regexp;
-
-    /** {@inheritDoc} */
-    @Override public Class<?> getObjectType() {
-        return Pattern.class;
-    }
-
-    /**
-     * set case sensitivity.
-     * 
-     * @return Returns the caseSensitive.
-     */
-    public Boolean getCaseSensitive() {
-        return caseSensitive;
-    }
-
-    /**
-     * get case sensitivity.
-     * 
-     * @param what The value to set.
-     */
-    public void setCaseSensitive(@Nullable final Boolean what) {
-        caseSensitive = what;
-    }
-
-    /**
-     * Get the regular expression.
-     * 
-     * @return Returns the regexp.
-     */
-    @Nullable public String getRegexp() {
-        return regexp;
-    }
-
-    /**
-     * Set the regular expression.
-     * 
-     * @param what what to set.
-     */
-    public void setRegexp(@Nonnull final String what) {
-        regexp = what;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected Pattern doCreateInstance() throws Exception {
-        Constraint.isNotNull(regexp, "Regular expression cannot be null");
-        
-        if (null == getCaseSensitive() || getCaseSensitive()) {
-            return Pattern.compile(regexp, 0);
-        } else {
-            return Pattern.compile(regexp, Pattern.CASE_INSENSITIVE);
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/impl/RegexSplitAttributeDefinitionParser.java b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/impl/RegexSplitAttributeDefinitionParser.java
index ab52397..0431d91 100644
--- a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/impl/RegexSplitAttributeDefinitionParser.java
+++ b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/ad/impl/RegexSplitAttributeDefinitionParser.java
@@ -28,9 +28,9 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.ParserContext;
 import org.w3c.dom.Element;
 
+import net.shibboleth.ext.spring.factory.PatternFactoryBean;
 import net.shibboleth.idp.attribute.resolver.ad.impl.RegexSplitAttributeDefinition;
 import net.shibboleth.idp.attribute.resolver.spring.ad.BaseAttributeDefinitionParser;
-import net.shibboleth.idp.attribute.resolver.spring.ad.PatternFactoryBean;
 import net.shibboleth.idp.attribute.resolver.spring.impl.AttributeResolverNamespaceHandler;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list