class urn_perun_user_attribute_def_def_vsupMailAliases extends UserAttributesModuleAbstract implements UserAttributesModuleImplApi {

	@Override
	public void checkAttributeSyntax(PerunSessionImpl sess, User user, Attribute attribute) throws WrongAttributeValueException {

		List<String> mails = (attribute.getValue() != null) ? (attribute.valueAsList()) : (new ArrayList<>());

		for (String mail : mails) {
			Matcher emailMatcher = emailPattern.matcher(mail);
			if(!emailMatcher.find()) throw new WrongAttributeValueException(attribute, user, "Following value of School mail aliases is not in a correct form: '"+mail+"'.");
		}

		// TODO - check uniqueness within list of values ??

	}

}