+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * org.apache.harmony.accessibility.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * org.apache.harmony.annotation.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * org.apache.harmony.annotation.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * org.apache.harmony.applet.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * org.apache.harmony.applet.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * org.apache.harmony.archive.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * It is used by the system classes to provide national language support, by
+ * looking up messages in the
+ * To insert the "{" character into the output, use a single backslash
+ * character to escape it (i.e. "\{"). The "}" character does not need to be
+ * escaped.
+ *
+ * @param format
+ * String the format to use when printing.
+ * @param args
+ * Object[] the arguments to use.
+ * @return String the formatted message.
+ */
+ public static String format(String format, Object[] args) {
+ StringBuilder answer = new StringBuilder(format.length()
+ + (args.length * 20));
+ String[] argStrings = new String[args.length];
+ for (int i = 0; i < args.length; ++i) {
+ if (args[i] == null)
+ argStrings[i] = "
+ * org.apache.harmony.archive.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.auth.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.auth.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.awt.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.awt.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.beans.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.beans.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.crypto.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.crypto.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.instrument.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.instrument.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.jndi.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.jndi.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.logging.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.logging.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.luni.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.luni.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.math.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.math.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.misc.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.misc.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.net.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.net.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.nio.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.nio.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.prefs.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.prefs.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.regex.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.regex.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.rmi.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.rmi.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.security.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.security.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.sound.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.sound.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.sql.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
public class Messages {
// ResourceBundle holding the system messages.
static private ResourceBundle bundle = null;
- static {
- // Attempt to load the messages.
- try {
- bundle = MsgHelp.setLocale(
- Locale.getDefault(),
- "org.apache.harmony.sql.internal.nls.messages"); //$NON-NLS-1$
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
/**
* Retrieves a message which has no arguments.
*
@@ -124,9 +136,107 @@
try {
format = bundle.getString(msg);
} catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
}
}
- return MsgHelp.format(format, args);
+ return format(format, args);
}
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.swing.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.swing.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.text.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.text.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.tools.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *
+ * org.apache.harmony.tools.internal.nls.messages
+ *
+ * resource bundle. Note that if this file is not available, or an invalid key
+ * is looked up, or resource bundle support is not available, the key itself
+ * will be returned as the associated message. This means that the KEY
+ * should a reasonable human-readable (english) string.
+ *
+ */
+public class Messages {
+
+ // ResourceBundle holding the system messages.
+ static private ResourceBundle bundle = null;
+
+ /**
+ * Retrieves a message which has no arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg) {
+ if (bundle == null)
+ return msg;
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ return "Missing message: " + msg; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Retrieves a message which takes 1 argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * Object the object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg) {
+ return getString(msg, new Object[] { arg });
+ }
+
+ /**
+ * Retrieves a message which takes 1 integer argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * int the integer to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, int arg) {
+ return getString(msg, new Object[] { Integer.toString(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 1 character argument.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg
+ * char the character to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, char arg) {
+ return getString(msg, new Object[] { String.valueOf(arg) });
+ }
+
+ /**
+ * Retrieves a message which takes 2 arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param arg1
+ * Object an object to insert in the formatted output.
+ * @param arg2
+ * Object another object to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object arg1, Object arg2) {
+ return getString(msg, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Retrieves a message which takes several arguments.
+ *
+ * @param msg
+ * String the key to look up.
+ * @param args
+ * Object[] the objects to insert in the formatted output.
+ * @return String the message for that key in the system message bundle.
+ */
+ static public String getString(String msg, Object[] args) {
+ String format = msg;
+
+ if (bundle != null) {
+ try {
+ format = bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ }
+ }
+
+ return format(format, args);
+ }
+
+ /**
+ * Generates a formatted text string given a source string containing
+ * "argument markers" of the form "{argNum}" where each argNum must be in
+ * the range 0..9. The result is generated by inserting the toString of each
+ * argument into the position indicated in the string.
+ *