001
014
015 package com.liferay.portal.format;
016
017 import com.liferay.portal.kernel.format.PhoneNumberFormat;
018 import com.liferay.portal.kernel.util.Validator;
019 import com.liferay.portal.util.PropsValues;
020
021
025 public class InternationalPhoneNumberFormatImpl implements PhoneNumberFormat {
026
027 public String format(String phoneNumber) {
028 return phoneNumber;
029 }
030
031 public String strip(String phoneNumber) {
032 return phoneNumber;
033 }
034
035 public boolean validate(String phoneNumber) {
036 if (Validator.isNull(phoneNumber)) {
037 return false;
038 }
039
040 return phoneNumber.matches(
041 PropsValues.PHONE_NUMBER_FORMAT_INTERNATIONAL_REGEXP);
042 }
043
044 }