public final class PhoneNumberFormatAttribute extends FormatAttribute
phone
format attribute.
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 | Method and Description |
---|---|
void |
checkValue(String fmt,
ValidationReport report,
JsonNode value)
Abstract method implemented by all attributes
|
static FormatAttribute |
getInstance() |
newMsg, validate
public static FormatAttribute getInstance()
public void checkValue(String fmt, ValidationReport report, JsonNode value)
FormatAttribute
It is only called if the value type is one expected by the
attribute, see FormatAttribute.validate(String, ValidationReport, JsonNode)
.
checkValue
in class FormatAttribute
fmt
- the format attribute namereport
- the validation reportvalue
- the value to validateCopyright © 2013. All Rights Reserved.