Class IDNAProcessor
java.lang.Object
com.centralnicreseller.apiconnector.IDNAProcessor
Utility class for processing domain names using the IDNA protocol.
IDNAProcessor.java.
- Since:
- 5.0
- Version:
- %I%, %G%
- Author:
- Asif Nawaz
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isTransitionalProcessing
(String domainName) Determines whether the domain name should be processed using transitional processing based on its TLD.static String
Converts a domain name to its ASCII representation using the appropriate IDNA processing method.static String
Converts a domain name to its ASCII representation, specifying whether to use transitional processing.static String
Converts a domain name to its Unicode representation using the appropriate IDNA processing method.static String
Converts a domain name to its Unicode representation, specifying whether to use transitional processing.
-
Method Details
-
isTransitionalProcessing
Determines whether the domain name should be processed using transitional processing based on its TLD.- Parameters:
domainName
- The domain name to check.- Returns:
true
if the domain name should use transitional processing;false
otherwise.
-
toASCII
Converts a domain name to its ASCII representation using the appropriate IDNA processing method.- Parameters:
domainName
- The domain name to convert.- Returns:
- The ASCII representation of the domain name.
- Throws:
IllegalArgumentException
- if the domain name cannot be converted to ASCII.
-
toASCII
Converts a domain name to its ASCII representation, specifying whether to use transitional processing.- Parameters:
domainName
- The domain name to convert.useTransitional
- Whether to use transitional processing.- Returns:
- The ASCII representation of the domain name.
- Throws:
IllegalArgumentException
- if the domain name cannot be converted to ASCII.
-
toUnicode
Converts a domain name to its Unicode representation using the appropriate IDNA processing method.- Parameters:
domainName
- The domain name to convert.- Returns:
- The Unicode representation of the domain name.
- Throws:
IllegalArgumentException
- if the domain name cannot be converted to Unicode.
-
toUnicode
Converts a domain name to its Unicode representation, specifying whether to use transitional processing.- Parameters:
domainName
- The domain name to convert.useTransitional
- Whether to use transitional processing.- Returns:
- The Unicode representation of the domain name.
- Throws:
IllegalArgumentException
- if the domain name cannot be converted to Unicode.
-