int pos = 0;
for ( Value<?> value : attr )
{
MatchingRule matchingRule = null;
try
{
matchingRule = matchingRuleParser.parseMatchingRuleDescription( value.getString() );
matchingRule.setSpecification( value.getString() );
}
catch ( ParseException e )
{
LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(
ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_424,
value.getString() ) );
iave.initCause( e );
throw iave;
}
if ( !schemaManager.getLdapSyntaxRegistry().contains( matchingRule.getSyntaxOid() ) )
{
throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
I18n.err( I18n.ERR_425, matchingRule.getSyntaxOid() ) );
}
matchingRules[pos++] = matchingRule;
}