int pos = 0;
for ( Value<?> value:attr )
{
LdapSyntaxDescription desc = null;
try
{
desc = syntaxParser.parseLdapSyntaxDescription( value.getString() );
}
catch ( ParseException e )
{
LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(
"The following does not conform to the ldapSyntaxDescription syntax: " + value.getString(),
ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
iave.setRootCause( e );
throw iave;
}
if ( ! dao.hasSyntaxChecker( desc.getNumericOid() ) )
{
throw new LdapOperationNotSupportedException(
"Cannot permit the addition of a syntax without the prior creation of a " +
"\nsyntaxChecker with the same object identifier of the syntax!",
ResultCodeEnum.UNWILLING_TO_PERFORM );
}
SyntaxImpl syntax = new SyntaxImpl( desc.getNumericOid(), globalRegistries.getSyntaxCheckerRegistry() );
setSchemaObjectProperties( desc, syntax );
syntax.setHumanReadable( isHumanReadable( desc ) );
syntaxes[pos++] = syntax;
}