RTEditor/src/main/java/com/onegravity/rteditor/utils/validator/EmailValidator.java
protected boolean isValidDomain(String domain) {
        // see if domain is an IP address in brackets
        Matcher ipDomainMatcher = IP_DOMAIN_PATTERN.matcher(domain);

        if (ipDomainMatcher.matches()) {
            InetAddressValidator inetAddressValidator =
                    InetAddressValidator.getInstance();
            return inetAddressValidator.isValid(ipDomainMatcher.group(1));
        }
        // Domain is symbolic name
        DomainValidator domainValidator =
                DomainValidator.getInstance(allowLocal);
        return domainValidator.isValid(domain) ||
                domainValidator.isValidTld(domain);
    }
protected boolean isValidDomain(String domain) {
        // see if domain is an IP address in brackets
        Matcher ipDomainMatcher = IP_DOMAIN_PATTERN.matcher(domain);

        if (ipDomainMatcher.matches()) {
            InetAddressValidator inetAddressValidator =
                    InetAddressValidator.getInstance();
            return inetAddressValidator.isValid(ipDomainMatcher.group(1));
        }
        // Domain is symbolic name
        DomainValidator domainValidator =
                DomainValidator.getInstance(allowLocal);
        return domainValidator.isValid(domain) ||
                domainValidator.isValidTld(domain);
    }
protected boolean isValidDomain ( String domain ) { // see if domain is an IP address in brackets Matcher ipDomainMatcher = IP_DOMAIN_PATTERN . matcher ( domain ) ; if ( ipDomainMatcher . matches ( ) ) { InetAddressValidator inetAddressValidator = InetAddressValidator . getInstance ( ) ; return inetAddressValidator . isValid ( ipDomainMatcher . group ( 1 ) ) ; } // Domain is symbolic name DomainValidator domainValidator = DomainValidator . getInstance ( allowLocal ) ; return domainValidator . isValid ( domain ) || domainValidator . isValidTld ( domain ) ; }
Returns true if the domain component of an email address is valid.

@param domain being validated, may be in IDN format
@return true if the email address's domain is valid.
Returns true if the domain component of an email address is valid .