public interface IDNA
The jp.co.jprs.idnkit.IDNA interface defines manipulations of internationalized domain names using idnkit.
This interface defines almost the same methods as idnkit library provides. Its main functions are encoding (conversion to ASCII) and decoding (conversion to UTF-8) domain names.
Currently, the package provides IDNA2008 class as an implementation of the jp.co.jprs.idnkit.IDNA interface. To create an IDNA2008 instance, IDNAFactory class is used instead of a constructor of IDNA2008 class.
IDNAFactory
,
IDNA2008
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_LOOKUP
Action value to validate a domain name with the domain name lookup
protocol.
|
static int |
CHECK_REGIST
Action value to validate a domain name with the domain name
registration protocol.
|
static int |
COMPARE_LOOKUP
Action value to compare two domain names with the domain name lookup
protocol.
|
static int |
COMPARE_REGIST
Action value to compare two domain names with the domain name
registration protocol.
|
static int |
DECODE_LOOKUP
Action value to decode a domain name with the domain name lookup
protocol.
|
static int |
DECODE_REGIST
Action value to decode a domain name with the domain name registration
protocol.
|
static int |
ENCODE_LOOKUP
Action value to encode a domain name with the domain name lookup
protocol.
|
static int |
ENCODE_REGIST
Action value to encode a domain name with the domain name registration
protocol.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check(int actions,
java.lang.String name)
Validates a domain name.
|
boolean |
check(java.lang.String name)
Validates a domain name.
|
boolean |
compare(int actions1,
java.lang.String name1,
int actions2,
java.lang.String name2)
Compares two domain names.
|
boolean |
compare(int actions,
java.lang.String name1,
java.lang.String name2)
Compares two domain names.
|
boolean |
compare(java.lang.String name1,
java.lang.String name2)
Compares two domain names.
|
java.lang.String |
decode(int actions,
java.lang.String name)
Converts a domain name 'name' to UTF-8 and returns the result.
|
java.lang.String |
decode(java.lang.String name)
Converts a domain name 'name' to UTF-8 and returns the result.
|
java.lang.String |
encode(int actions,
java.lang.String name)
Converts a domain name 'name' to ASCII and returns the result.
|
java.lang.String |
encode(java.lang.String name)
Converts a domain name 'name' to ASCII, and returns the result.
|
java.lang.String |
getIdnaTableVersion()
Gets a version of IDNA tables the context instance supports.
|
java.lang.String |
getLibIDNVersion()
Gets a version of idnkit library.
|
java.lang.String |
getUnicodeVersion()
Gets a version of Unicode tables the context instance supports.
|
java.lang.String |
getVersion()
Returns version information.
|
void |
init()
Initializes the conversion context instance.
|
void |
init(java.lang.String filename)
Initializes the conversion context instance.
|
void |
init(java.lang.String[] conf)
Initializes the conversion context instance.
|
void |
setLocalCheckFile(java.lang.String filename)
Reads a code point set for local-check from a file 'filename'.
|
static final int ENCODE_REGIST
static final int ENCODE_LOOKUP
static final int DECODE_REGIST
static final int DECODE_LOOKUP
static final int COMPARE_REGIST
static final int COMPARE_LOOKUP
static final int CHECK_REGIST
static final int CHECK_LOOKUP
void init() throws IDNException
IDNException
- Initialization failed.void init(java.lang.String filename) throws IDNException
filename
- Configuration file to be read.IDNException
- Initialization failed.void init(java.lang.String[] conf) throws IDNException
conf
- Configurations to be set.IDNException
- Initialization failed.void setLocalCheckFile(java.lang.String filename) throws IDNException
filename
- Code point set file to be read.IDNException
- Failed to read the file.java.lang.String encode(java.lang.String name) throws IDNException
name
- A domain name to be encoded.IDNException
- Conversion failed.java.lang.String encode(int actions, java.lang.String name) throws IDNException
actions
- An action value to encode 'name'.name
- A domain name to be encoded.IDNException
- Conversion failed.java.lang.String decode(java.lang.String name) throws IDNException
name
- A domain name to be decoded.IDNException
- Conversion failed.java.lang.String decode(int actions, java.lang.String name) throws IDNException
actions
- An action value to decode 'name'.name
- A domain name to be decoded.IDNException
- Conversion failed.boolean compare(java.lang.String name1, java.lang.String name2) throws IDNException
name1
- A domain name #1.name2
- A domain name #2.IDNException
- Conversion of domain names failed.boolean compare(int actions, java.lang.String name1, java.lang.String name2) throws IDNException
actions
- An Action value to encode 'name1' and 'name2'.name1
- A domain name #1.name2
- A domain name #2.IDNException
- Conversion of domain names failed.boolean compare(int actions1, java.lang.String name1, int actions2, java.lang.String name2) throws IDNException
actions1
- An Action value to encode 'name1'.name1
- A domain name #1.actions2
- An Action value to encode 'name2'.name2
- A domain name #2.IDNException
- Conversion of domain names failed.boolean check(java.lang.String name) throws IDNException
name
- A domain name to be validated.IDNException
- Conversion of domain names failed.boolean check(int actions, java.lang.String name) throws IDNException
name
- A domain name to be validated.actions
- An Action value to encode 'name'.IDNException
- Conversion of domain names failed.java.lang.String getUnicodeVersion()
java.lang.String getIdnaTableVersion()
java.lang.String getLibIDNVersion()
java.lang.String getVersion()