protected void checkAttributesMap(MessageContext context, String basePath, Set<String> swappableAttributes, Map<String, Attribute> attributesToCopy) {
for (final String attribute : attributesToCopy.keySet()) {
if (!swappableAttributes.contains(attribute)) {
final MessageBuilder messageBuilder = new MessageBuilder();
messageBuilder.error();
messageBuilder.source(basePath + "[" + attribute + "].value");
messageBuilder.code("attributesForm.invalidSwapAttribute");
messageBuilder.arg(attribute);
final MessageResolver errorMessage = messageBuilder.build();
context.addMessage(errorMessage);