Namespace PhoneNumbers
Classes
- AsYouTypeFormatter
A formatter which formats phone numbers as they are entered.
An AsYouTypeFormatter can be created by invoking GetAsYouTypeFormatter(string). After that, digits can be added by invoking InputDigit(char) on the formatter instance, and the partially formatted phone number will be returned each time a digit is added. {@link #clear} can be invoked before formatting a new number.
See the unittests for more details on how the formatter is to be used.
- LocaleData
Holds a map from ISO 3166-1 country code (e.g. GB) to a dict. Each dict maps from an ISO 639-1 language code (e.g. ja) to the country's name in that language.
- MissingMetadataException
Thrown when metadata for a region or country calling code that is expected to exist cannot be loaded (resource missing, stream truncated, etc.). Mirrors
com.google.i18n.phonenumbers.MissingMetadataExceptionin the Java upstream.
- PhoneNumberMatcher
The phone number pattern used by {@link #find}, similar to
PhoneNumberUtil.VALID_PHONE_NUMBER, but with the following differences:- All captures are limited in order to place an upper bound to the text matched by the pattern.
- Leading punctuation / plus signs are limited.
- Consecutive occurrences of punctuation are limited.
- Number of digits is limited.
- No whitespace is allowed at the start or end.
- No alpha digits (vanity numbers such as 1-800-SIX-FLAGS) are currently supported.
- PhoneNumberOfflineGeocoder
An offline geocoder which provides geographical information related to a phone number.
- PhoneNumberToCarrierMapper
A phone prefix mapper which provides carrier information related to a phone number.
Carrier data is the one the number was originally allocated to. If the country supports mobile number portability the number might not belong to the returned carrier anymore.
- PhoneNumberUtil
Utility for international phone numbers. Functionality includes formatting, parsing and validation.
If you use this library, and want to be notified about important changes, please sign up to our mailing list: http://groups.google.com/group/libphonenumber-discuss/about
NOTE: A lot of methods in this class require Region Code strings.These must be provided using ISO 3166-1 two-letter country-code format.These should be in upper-case. The list of the codes can be found here: http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm
- ShortNumberInfo
Methods for getting information about short phone numbers, such as short codes and emergency numbers. Note that most commercial short numbers are not handled here, but by the PhoneNumberUtil.
@author Shaopeng Jia @author David Yonge-Mallo
Enums
- ErrorType
The reason that a string could not be interpreted as a phone number.
- PhoneNumberFormat
INTERNATIONAL and NATIONAL formats are consistent with the definition in ITU-T Recommendation E123. For example, the number of the Google Switzerland office will be written as "+41 44 668 1800" in INTERNATIONAL format, and as "044 668 1800" in NATIONAL format. E164 format is as per INTERNATIONAL format but with no formatting applied, e.g. "+41446681800". RFC3966 is as per INTERNATIONAL format, but with all spaces and other separating symbols replaced with a hyphen, and with any phone number extension appended with ";ext=". It also will have a prefix of "tel:" added, e.g. "tel:+41-44-668-1800".
Note: If you are considering storing the number in a neutral format, you are highly advised to use the PhoneNumber class.
- PhoneNumberUtil.Leniency
Leniency when FindNumbers(string, string) finding potential phone numbers in text segments. The levels here are ordered in increasing strictness.
- PhoneNumberUtil.MatchType
Types of phone number matches. See detailed description beside the isNumberMatch() method.
- PhoneNumberUtil.ValidationResult
Possible outcomes when testing if a PhoneNumber is possible.
- ShortNumberInfo.ShortNumberCost
Cost categories of short numbers.
Delegates
- PhoneNumberMatcher.CheckGroups
Returns true if the groups of digits found in our candidate phone number match our expectations.