From cfc513043c5830b5a967733066068c7097b42e3c Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.

---
 opendj-sdk/opends/src/server/org/opends/server/util/args/MultiChoiceArgument.java |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/util/args/MultiChoiceArgument.java b/opendj-sdk/opends/src/server/org/opends/server/util/args/MultiChoiceArgument.java
index f1bafd2..4bf87d0 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/util/args/MultiChoiceArgument.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/util/args/MultiChoiceArgument.java
@@ -25,13 +25,14 @@
  *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
  */
 package org.opends.server.util.args;
+import org.opends.messages.Message;
 
 
 
 import java.util.HashSet;
 
-import static org.opends.server.messages.MessageHandler.*;
-import static org.opends.server.messages.UtilityMessages.*;
+import static org.opends.messages.UtilityMessages.*;
+import org.opends.messages.MessageBuilder;
 import static org.opends.server.util.StaticUtils.*;
 
 
@@ -75,10 +76,8 @@
    *                           formatted in lowercase.
    * @param  caseSensitive     Indicates whether the set of allowed values
    *                           should be treated in a case-sensitive manner.
-   * @param  descriptionID     The unique ID of the description for this
+   * @param  description       Message for the description of this
    *                           argument.
-   * @param  descriptionArgs   The arguments that are to be used when generating
-   *                           the description for this argument.
    *
    * @throws  ArgumentException  If there is a problem with any of the
    *                             parameters used to create this argument.
@@ -87,12 +86,12 @@
                              String longIdentifier, boolean isRequired,
                              boolean needsValue, String valuePlaceholder,
                              HashSet<String> allowedValues,
-                             boolean caseSensitive, int descriptionID,
-                             Object... descriptionArgs)
+                             boolean caseSensitive,
+                             Message description)
          throws ArgumentException
   {
     super(name, shortIdentifier, longIdentifier, isRequired, false, needsValue,
-          valuePlaceholder, null, null, descriptionID, descriptionArgs);
+          valuePlaceholder, null, null, description);
 
     this.allowedValues = allowedValues;
     this.caseSensitive = caseSensitive;
@@ -131,10 +130,8 @@
    *                           formatted in lowercase.
    * @param  caseSensitive     Indicates whether the set of allowed values
    *                           should be treated in a case-sensitive manner.
-   * @param  descriptionID     The unique ID of the description for this
+   * @param  description       Message for the description of this
    *                           argument.
-   * @param  descriptionArgs   The arguments that are to be used when generating
-   *                           the description for this argument.
    *
    * @throws  ArgumentException  If there is a problem with any of the
    *                             parameters used to create this argument.
@@ -144,13 +141,13 @@
                              boolean isMultiValued, boolean needsValue,
                              String valuePlaceholder, String defaultValue,
                              String propertyName, HashSet<String> allowedValues,
-                             boolean caseSensitive, int descriptionID,
-                             Object... descriptionArgs)
+                             boolean caseSensitive,
+                             Message description)
          throws ArgumentException
   {
     super(name, shortIdentifier, longIdentifier, isRequired, isMultiValued,
           needsValue, valuePlaceholder, defaultValue, propertyName,
-          descriptionID, descriptionArgs);
+          description);
 
     this.allowedValues = allowedValues;
     this.caseSensitive = caseSensitive;
@@ -197,14 +194,14 @@
    *          <CODE>false</CODE> if it is not.
    */
   public boolean valueIsAcceptable(String valueString,
-                                   StringBuilder invalidReason)
+                                   MessageBuilder invalidReason)
   {
     if (caseSensitive)
     {
       if (! allowedValues.contains(valueString))
       {
-        int msgID = MSGID_MCARG_VALUE_NOT_ALLOWED;
-        invalidReason.append(getMessage(msgID, getName(), valueString));
+        invalidReason.append(ERR_MCARG_VALUE_NOT_ALLOWED.get(
+                getName(), valueString));
 
         return false;
       }
@@ -213,8 +210,8 @@
     {
       if (! allowedValues.contains(toLowerCase(valueString)))
       {
-        int msgID = MSGID_MCARG_VALUE_NOT_ALLOWED;
-        invalidReason.append(getMessage(msgID, getName(), valueString));
+        invalidReason.append(
+                ERR_MCARG_VALUE_NOT_ALLOWED.get(getName(), valueString));
 
         return false;
       }

--
Gitblit v1.10.0