if ( matchingRule == null )
{
matchingRule = attributeType.getEquality();
}
Normalizer normalizer = matchingRule.getNormalizer();
// get the attribute
Attribute attr = entry.get( snode.getAttribute() );
// if the attribute does not exist just return false
if ( null == attr )
{
return false;
}
// compile the regular expression to search for a matching attribute
try
{
regex = snode.getRegex( normalizer );
}
catch ( PatternSyntaxException pse )
{
LdapInvalidSearchFilterException ne = new LdapInvalidSearchFilterException( I18n.err( I18n.ERR_248, node ) );
ne.initCause( pse );
throw ne;
}
/*
* Cycle through the attribute values testing normalized version
* obtained from using the substring matching rule's normalizer.
* The test uses the comparator obtained from the appropriate
* substring matching rule.
*/
for ( Value<?> value : attr )
{
String normValue = normalizer.normalize( value.getString() );
// Once match is found cleanup and return true
if ( regex.matcher( normValue ).matches() )
{