public final class PhoneNumberFormatSpecifier extends FormatSpecifier
phone format specification
The draft says the phone MAY match E.123. Quite vague. Here we use Google's libphonenumber as it is a library specialized in phone number recognition.
It will only chek if this is a potential phone number,
not whether it is actually valid for your country! If you really want
that, you will probably want to write your own KeywordValidator.
| Modifier and Type | Field and Description |
|---|---|
private static FormatSpecifier |
instance |
private static com.google.i18n.phonenumbers.PhoneNumberUtil |
parser |
| Modifier | Constructor and Description |
|---|---|
private |
PhoneNumberFormatSpecifier() |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
checkValue(List<String> messages,
JsonNode value)
Abstract method implemented by all specifiers
|
static FormatSpecifier |
getInstance() |
validateprivate static final FormatSpecifier instance
private static final com.google.i18n.phonenumbers.PhoneNumberUtil parser
public static FormatSpecifier getInstance()
void checkValue(List<String> messages, JsonNode value)
FormatSpecifierIt is only called if the value type is one expected by the
specifier, see FormatSpecifier.validate(List, JsonNode).
checkValue in class FormatSpecifiermessages - the list of messages to fillvalue - the value to validateCopyright © 2012. All Rights Reserved.