class DomainValidator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String[] |
COUNTRY_CODE_TLDS |
(package private) static java.util.regex.Pattern |
domainRegex
RegexValidator for matching domains.
|
private static java.lang.String[] |
GENERIC_TLDS |
private static java.lang.String[] |
INFRASTRUCTURE_TLDS |
| Constructor and Description |
|---|
DomainValidator() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isValid(java.lang.String domain)
Returns true if the specified
String parses
as a valid domain name with a recognized top-level domain. |
static boolean |
isValidTld(java.lang.String tld)
Returns true if the specified
String matches any
IANA-defined top-level domain. |
(package private) static java.lang.String |
unicodeToASCII(java.lang.String input)
Converts potentially Unicode input to punycode.
|
static final java.util.regex.Pattern domainRegex
private static final java.lang.String[] INFRASTRUCTURE_TLDS
private static final java.lang.String[] GENERIC_TLDS
private static final java.lang.String[] COUNTRY_CODE_TLDS
public static boolean isValid(java.lang.String domain)
String parses
as a valid domain name with a recognized top-level domain.
The parsing is case-insensitive.domain - the parameter to check for domain name syntaxpublic static boolean isValidTld(java.lang.String tld)
String matches any
IANA-defined top-level domain. Leading dots are ignored if present.
The search is case-insensitive.tld - the parameter to check for TLD status, not nullstatic java.lang.String unicodeToASCII(java.lang.String input)
input - the string to convert, not null