.getSyntaxEnforcementPolicy();
AttributeSyntax<?> syntax = attr.getAttributeType().getSyntax();
if (syntaxPolicy == AcceptRejectWarn.REJECT)
{
MessageBuilder invalidReason = new MessageBuilder();
for (AttributeValue v : attr)
{
if (!syntax.valueIsAcceptable(v.getValue(), invalidReason))
{
throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
ERR_MODIFY_ADD_INVALID_SYNTAX.get(String.valueOf(entryDN), attr
.getName(), v.getValue().toString(), invalidReason));
}
}
}
else if (syntaxPolicy == AcceptRejectWarn.WARN)
{
MessageBuilder invalidReason = new MessageBuilder();
for (AttributeValue v : attr)
{
if (!syntax.valueIsAcceptable(v.getValue(), invalidReason))
{
setResultCode(ResultCode.INVALID_ATTRIBUTE_SYNTAX);
logError(ERR_MODIFY_ADD_INVALID_SYNTAX.get(String.valueOf(entryDN),
attr.getName(), v.getValue().toString(), invalidReason));
invalidReason = new MessageBuilder();
}
}
}
}