int pos = 0;
for ( Value<?> value:attr )
{
NameFormDescription desc = null;
try
{
desc = nameFormParser.parseNameFormDescription( value.getString() );
}
catch ( ParseException e )
{
LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(
"The following does not conform to the nameFormDescription syntax: " + value.getString(),
ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
iave.setRootCause( e );
throw iave;
}
NameFormImpl nf = new NameFormImpl( desc.getNumericOid(), globalRegistries );
nf.setMayUseOids( desc.getMayAttributeTypes().toArray( EMPTY ) );
nf.setMustUseOids( desc.getMustAttributeTypes().toArray( EMPTY ) );
nf.setObjectClassOid( desc.getStructuralObjectClass() );
setSchemaObjectProperties( desc, nf );
nameForms[pos++] = nf;
}