class urn_perun_member_attribute_def_def_phone extends MemberAttributesModuleAbstract implements MemberAttributesModuleImplApi {

	public void checkAttributeSyntax(PerunSessionImpl perunSession, Member member, Attribute attribute) throws WrongAttributeValueException {
		if (attribute.getValue() == null) return;

		// wrong type of the attribute
		if (!(attribute.getValue() instanceof String)) throw new WrongAttributeValueException(attribute, "Wrong type of the attribute. Expected: String");

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

}