Package com.networknt.schema.format
Class IPv6AwareEmailValidator
java.lang.Object
com.networknt.org.apache.commons.validator.routines.EmailValidator
com.networknt.schema.format.IPv6AwareEmailValidator
- All Implemented Interfaces:
Serializable
This is an extension of the Apache Commons Validator that correctly
handles email addresses containing an IPv6 literal as the domain.
Apache's EmailValidator
delegates validation of the domain to
its DomainValidator
, which is not aware that it is validating
an email address, which has a peculiar way of representing an IPv6
literal.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIPv6AwareEmailValidator
(boolean allowLocal, boolean allowTld) Creates a new IPv6AwareEmailValidator. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isValidDomain
(String domain) Returns true if the domain component of an email address is valid.Methods inherited from class com.networknt.org.apache.commons.validator.routines.EmailValidator
getInstance, getInstance, getInstance, isValid, isValidUser
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
IPv6AwareEmailValidator
public IPv6AwareEmailValidator(boolean allowLocal, boolean allowTld) Creates a new IPv6AwareEmailValidator.- Parameters:
allowLocal
- Should local addresses be considered valid?allowTld
- Should TLDs be allowed?
-
-
Method Details
-
isValidDomain
Description copied from class:EmailValidator
Returns true if the domain component of an email address is valid.- Overrides:
isValidDomain
in classEmailValidator
- Parameters:
domain
- being validated, may be in IDN format- Returns:
- true if the email address's domain is valid.
-