class urn_perun_user_attribute_def_def_phone extends UserAttributesModuleAbstract implements UserAttributesModuleImplApi {

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

		String phone = attribute.valueAsString();

		Matcher matcher = pattern.matcher(phone);
		if (!matcher.matches()) {
			throw new WrongAttributeValueException(attribute, "Phone is not in correct format!");
		}
	}

}