com.github.fge.jsonschema.format.draftv3
Class PhoneAttribute
java.lang.Object
com.github.fge.jsonschema.format.AbstractFormatAttribute
com.github.fge.jsonschema.format.draftv3.PhoneAttribute
- All Implemented Interfaces:
- FormatAttribute
public final class PhoneAttribute
- extends AbstractFormatAttribute
Attempt to validate the 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 FormatAttribute
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getInstance
public static FormatAttribute getInstance()
validate
public void validate(ProcessingReport report,
FullData data)
throws ProcessingException
- Description copied from interface:
FormatAttribute
- Validate the instance against this format attribute
- Parameters:
report
- the report to usedata
- the validation data
- Throws:
ProcessingException
- an exception occurs (normally, never for a
format attribute)
Copyright © 2014. All Rights Reserved.