class urn_perun_resource_attribute_def_def_mailaliasesTargetUser extends ResourceAttributesModuleAbstract implements ResourceAttributesModuleImplApi {

	@Override
	public void checkAttributeSyntax(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws WrongAttributeValueException {
		if (attribute.getValue() == null) return;

		String targetUser = attribute.valueAsString();
		Matcher userMatcher = userPattern.matcher(targetUser);
		if(!userMatcher.matches()) {
			throw new WrongAttributeValueException(attribute, resource, null, "Matcher must match to ^[-a-zA-Z0-9_]+$ pattern.");
		}
	}

}