Package net.shibboleth.idp.profile.logic
Class RegexAttributePredicate
- java.lang.Object
-
- net.shibboleth.idp.profile.logic.AbstractAttributePredicate
-
- net.shibboleth.idp.profile.logic.RegexAttributePredicate
-
- All Implemented Interfaces:
Predicate<org.opensaml.profile.context.ProfileRequestContext>,net.shibboleth.utilities.java.support.logic.Predicate<org.opensaml.profile.context.ProfileRequestContext>
public class RegexAttributePredicate extends AbstractAttributePredicate
Predicate that evaluates anAttributeContextand checks a specific attribute for value(s) that match a regular expression.This handles only simple string-valued data.
-
-
Field Summary
Fields Modifier and Type Field Description private StringattributeIdThe attribute to evaluate.private org.slf4j.LoggerlogClass logger.private PatternpatternRegular expression.
-
Constructor Summary
Constructors Constructor Description RegexAttributePredicate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAttributeId()Get the attribute ID to check.PatterngetPattern()Get the pattern to match the attribute values against.protected booleanhasMatch(Map<String,net.shibboleth.idp.attribute.IdPAttribute> attributeMap)Abstract implementation of the condition to evaluate.voidsetAttributeId(String id)Set the attribute ID to check.voidsetPattern(String s)Set the pattern to match the attribute values against.voidsetPattern(Pattern p)Set the pattern to match the attribute values against.-
Methods inherited from class net.shibboleth.idp.profile.logic.AbstractAttributePredicate
allowNullAttributeContext, getAttributeContextLookupStrategy, isUseUnfilteredAttributes, setAttributeContextLookupStrategy, setUseUnfilteredAttributes, test
-
-
-
-
Method Detail
-
getAttributeId
@Nullable @NotEmpty public String getAttributeId()
Get the attribute ID to check.- Returns:
- the attribute ID to check
-
setAttributeId
public void setAttributeId(@Nonnull @NotEmpty String id)Set the attribute ID to check.- Parameters:
id- the attribute ID to check
-
getPattern
@Nullable public Pattern getPattern()
Get the pattern to match the attribute values against.- Returns:
- the pattern to match the attribute values against
-
setPattern
public void setPattern(@Nonnull Pattern p)Set the pattern to match the attribute values against.- Parameters:
p- the pattern to match the attribute values against
-
setPattern
public void setPattern(@Nonnull @NotEmpty String s)Set the pattern to match the attribute values against.- Parameters:
s- the pattern to match the attribute values against
-
hasMatch
protected boolean hasMatch(@Nonnull @NonnullElements Map<String,net.shibboleth.idp.attribute.IdPAttribute> attributeMap)Abstract implementation of the condition to evaluate.- Specified by:
hasMatchin classAbstractAttributePredicate- Parameters:
attributeMap- the attributes to evaluate- Returns:
- the condition result
-
-