|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.io.IDNA
public class IDNA
This class provides methods to encode and decode host names
as per the IDNA algorithm defined in RFC3490.
This method provides implementations of the ToASCII
and ToUnicode operations defined in RFC3490, as well
as a few convenience methods to more simply use the class.
| Field Summary | ||
|---|---|---|
static String |
ACE_PREFIX
The ASCII Compatible Encoding (ACE) prefix. |
|
| Method Summary | ||
|---|---|---|
static boolean |
checkNonASCII(String input)
Tests if the provided input string has non-ASCII code point. |
|
static String |
toASCII(String host)
This method performs the ToASCII operation on the provided
hostname string. |
|
static String |
toASCII(String input,
boolean allowUnassigned,
boolean useSTD3ASCIIRules)
The ToASCII operation takes a sequence of Unicode code points that make up one label and transforms it into a sequence of code points in the ASCII range (0..7F). |
|
static String |
toUnicode(String host)
This method performs the ToUnicode operation on the provided
IDNA-encoded hostname string. |
|
static String |
toUnicode(String input,
boolean allowUnassigned,
boolean useSTD3ASCIIRules)
The ToUnicode operation takes a sequence of Unicode code points that make up one label and returns a sequence of Unicode code points. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ACE_PREFIX
| Method Detail |
|---|
public static String toASCII(String host)
throws IDNAException
ToASCII operation on the provided
hostname string. Each label in the hostname string has the ToASCII
operation applied to it separately, and the label is then replaced
with the results of the operation.
host - The hostname to be IDNA-encoded. This must not be null.
null.
IDNAException - If the ToASCII operation fails as described
in RFC3490.
NullPointerException - If the host parameter is null.public static String toUnicode(String host)
ToUnicode operation on the provided
IDNA-encoded hostname string. Each label has the ToUnicode
operation applied to it separately, and the label is then replaced
with the results of the operation.
host - The IDNA-encoded hostname. This must not be null.
null.
NullPointerException - If the host parameter is null.public static boolean checkNonASCII(String input)
input - The string to check for non-ASCII code points. This must not
be null.
true if any of the code point in input
are greater than or equal to U+0080, falseotherwise.
NullPointerException - If input is null.
public static String toASCII(String input,
boolean allowUnassigned,
boolean useSTD3ASCIIRules)
throws IDNAException
input - The label on which to perform the ToASCII operation. This
must not be null.allowUnassigned - The AllowUnassigned input flag to the ToASCII operation.useSTD3ASCIIRules - The UseSTD3ASCIIRules input flag to the ToASCII operation.
String that has only ASCII code points. This will not be null.
IDNAException - If the ToASCII operation fails.
NullPointerException - If the input parameter is null.
public static String toUnicode(String input,
boolean allowUnassigned,
boolean useSTD3ASCIIRules)
input - The label on which to perform the ToUnicode operation. This must
not be null.allowUnassigned - The AllowUnassigned input flag to the ToUnicode operation.useSTD3ASCIIRules - The UseSTD3ASCIIRules input flag to the ToUnicode operation.
null.
NullPointerException - If the input parameter is null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal