]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/text/IDNA.java
Upgrade ICU4J.
[Dictionary.git] / jars / icu4j-52_1 / main / classes / core / src / com / ibm / icu / text / IDNA.java
similarity index 92%
rename from jars/icu4j-4_8_1_1/main/classes/core/src/com/ibm/icu/text/IDNA.java
rename to jars/icu4j-52_1/main/classes/core/src/com/ibm/icu/text/IDNA.java
index be5c69ba7524a2c8b799561861ba775cf5a2fc9f..7a6078500f0e79937b6571cf5b98592ba902a234 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2003-2010, International Business Machines Corporation and    *
+ * Copyright (C) 2003-2013, International Business Machines Corporation and    *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
@@ -54,12 +54,14 @@ import com.ibm.icu.impl.UTS46;
 public abstract class IDNA {
     /** 
      * Default options value: None of the other options are set.
+     * For use in static worker and factory methods.
      * @stable ICU 2.8
      */
     public static final int DEFAULT = 0;
     /** 
      * Option to allow unassigned code points in domain names and labels.
-     * This option is ignored by the UTS46 implementation.
+     * For use in static worker and factory methods.
+     * <p>This option is ignored by the UTS46 implementation.
      * (UTS #46 disallows unassigned code points.)
      * @stable ICU 2.8
      */
@@ -68,43 +70,54 @@ public abstract class IDNA {
      * Option to check whether the input conforms to the STD3 ASCII rules,
      * for example the restriction of labels to LDH characters
      * (ASCII Letters, Digits and Hyphen-Minus).
+     * For use in static worker and factory methods.
      * @stable ICU 2.8
      */
     public static final int USE_STD3_RULES = 2;
     /**
      * IDNA option to check for whether the input conforms to the BiDi rules.
-     * This option is ignored by the IDNA2003 implementation.
+     * For use in static worker and factory methods.
+     * <p>This option is ignored by the IDNA2003 implementation.
      * (IDNA2003 always performs a BiDi check.)
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public static final int CHECK_BIDI = 4;
     /**
      * IDNA option to check for whether the input conforms to the CONTEXTJ rules.
-     * This option is ignored by the IDNA2003 implementation.
+     * For use in static worker and factory methods.
+     * <p>This option is ignored by the IDNA2003 implementation.
      * (The CONTEXTJ check is new in IDNA2008.)
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public static final int CHECK_CONTEXTJ = 8;
     /**
      * IDNA option for nontransitional processing in ToASCII().
-     * By default, ToASCII() uses transitional processing.
-     * This option is ignored by the IDNA2003 implementation.
+     * For use in static worker and factory methods.
+     * <p>By default, ToASCII() uses transitional processing.
+     * <p>This option is ignored by the IDNA2003 implementation.
      * (This is only relevant for compatibility of newer IDNA implementations with IDNA2003.)
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public static final int NONTRANSITIONAL_TO_ASCII = 0x10;
     /**
      * IDNA option for nontransitional processing in ToUnicode().
-     * By default, ToUnicode() uses transitional processing.
-     * This option is ignored by the IDNA2003 implementation.
+     * For use in static worker and factory methods.
+     * <p>By default, ToUnicode() uses transitional processing.
+     * <p>This option is ignored by the IDNA2003 implementation.
      * (This is only relevant for compatibility of newer IDNA implementations with IDNA2003.)
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public static final int NONTRANSITIONAL_TO_UNICODE = 0x20;
+    /**
+     * IDNA option to check for whether the input conforms to the CONTEXTO rules.
+     * For use in static worker and factory methods.
+     * <p>This option is ignored by the IDNA2003 implementation.
+     * (The CONTEXTO check is new in IDNA2008.)
+     * <p>This is for use by registries for IDNA2008 conformance.
+     * UTS #46 does not require the CONTEXTO check.
+     * @stable ICU 49
+     */
+    public static final int CHECK_CONTEXTO = 0x40;
 
     /**
      * Returns an IDNA instance which implements UTS #46.
@@ -131,8 +144,7 @@ public abstract class IDNA {
      *
      * @param options Bit set to modify the processing and error checking.
      * @return the UTS #46 IDNA instance, if successful
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public static IDNA getUTS46Instance(int options) {
         return new UTS46(options);
@@ -149,8 +161,7 @@ public abstract class IDNA {
      * @param dest Destination string object
      * @param info Output container of IDNA processing details.
      * @return dest
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public abstract StringBuilder labelToASCII(CharSequence label, StringBuilder dest, Info info);
 
@@ -163,8 +174,7 @@ public abstract class IDNA {
      * @param dest Destination string object
      * @param info Output container of IDNA processing details.
      * @return dest
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public abstract StringBuilder labelToUnicode(CharSequence label, StringBuilder dest, Info info);
 
@@ -179,8 +189,7 @@ public abstract class IDNA {
      * @param dest Destination string object
      * @param info Output container of IDNA processing details.
      * @return dest
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public abstract StringBuilder nameToASCII(CharSequence name, StringBuilder dest, Info info);
 
@@ -193,22 +202,19 @@ public abstract class IDNA {
      * @param dest Destination string object
      * @param info Output container of IDNA processing details.
      * @return dest
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public abstract StringBuilder nameToUnicode(CharSequence name, StringBuilder dest, Info info);
 
     /**
      * Output container for IDNA processing errors.
      * The Info class is not suitable for subclassing.
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public static final class Info {
         /**
          * Constructor.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         public Info() {
             errors=EnumSet.noneOf(Error.class);
@@ -220,15 +226,13 @@ public abstract class IDNA {
         /**
          * Were there IDNA processing errors?
          * @return true if there were processing errors
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         public boolean hasErrors() { return !errors.isEmpty(); }
         /**
          * Returns a set indicating IDNA processing errors.
          * @return set of processing errors (modifiable, and not null)
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         public Set<Error> getErrors() { return errors; }
         /**
@@ -242,8 +246,7 @@ public abstract class IDNA {
          * mapped (sharp s/sigma) or removed (joiner/nonjoiner).
          * </ul>
          * @return true if transitional and nontransitional processing produce different results
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         public boolean isTransitionalDifferent() { return isTransDiff; }
 
@@ -349,74 +352,63 @@ public abstract class IDNA {
      * IDNA error bit set values.
      * When a domain name or label fails a processing step or does not meet the
      * validity criteria, then one or more of these error bits are set.
-     * @draft ICU 4.6
-     * @provisional This API might change or be removed in a future release.
+     * @stable ICU 4.6
      */
     public static enum Error {
         /**
          * A non-final domain name label (or the whole domain name) is empty.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         EMPTY_LABEL,
         /**
          * A domain name label is longer than 63 bytes.
          * (See STD13/RFC1034 3.1. Name space specifications and terminology.)
          * This is only checked in ToASCII operations, and only if the output label is all-ASCII.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         LABEL_TOO_LONG,
         /**
          * A domain name is longer than 255 bytes in its storage form.
          * (See STD13/RFC1034 3.1. Name space specifications and terminology.)
          * This is only checked in ToASCII operations, and only if the output domain name is all-ASCII.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         DOMAIN_NAME_TOO_LONG,
         /**
          * A label starts with a hyphen-minus ('-').
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         LEADING_HYPHEN,
         /**
          * A label ends with a hyphen-minus ('-').
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         TRAILING_HYPHEN,
         /**
          * A label contains hyphen-minus ('-') in the third and fourth positions.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         HYPHEN_3_4,
         /**
          * A label starts with a combining mark.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         LEADING_COMBINING_MARK,
         /**
          * A label or domain name contains disallowed characters.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         DISALLOWED,
         /**
          * A label starts with "xn--" but does not contain valid Punycode.
          * That is, an xn-- label failed Punycode decoding.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         PUNYCODE,
         /**
          * A label contains a dot=full stop.
          * This can occur in an input string for a single-label function.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         LABEL_HAS_DOT,
         /**
@@ -425,22 +417,32 @@ public abstract class IDNA {
          * string had severe validation errors. For example,
          * it might contain characters that are not allowed in ACE labels,
          * or it might not be normalized.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         INVALID_ACE_LABEL,
         /**
          * A label does not meet the IDNA BiDi requirements (for right-to-left characters).
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
          */
         BIDI,
         /**
          * A label does not meet the IDNA CONTEXTJ requirements.
-         * @draft ICU 4.6
-         * @provisional This API might change or be removed in a future release.
+         * @stable ICU 4.6
+         */
+        CONTEXTJ,
+        /**
+         * A label does not meet the IDNA CONTEXTO requirements for punctuation characters.
+         * Some punctuation characters "Would otherwise have been DISALLOWED"
+         * but are allowed in certain contexts. (RFC 5892)
+         * @stable ICU 49
+         */
+        CONTEXTO_PUNCTUATION,
+        /**
+         * A label does not meet the IDNA CONTEXTO requirements for digits.
+         * Arabic-Indic Digits (U+066x) must not be mixed with Extended Arabic-Indic Digits (U+06Fx).
+         * @stable ICU 49
          */
-        CONTEXTJ
+        CONTEXTO_DIGITS
     }
 
     /**