Example usage for org.apache.commons.math3.exception.util Localizable getLocalizedString

List of usage examples for org.apache.commons.math3.exception.util Localizable getLocalizedString

Introduction

In this page you can find the example usage for org.apache.commons.math3.exception.util Localizable getLocalizedString.

Prototype

String getLocalizedString(Locale locale);

Source Link

Document

Gets the localized string.

Usage

From source file:org.orekit.errors.OrekitException.java

/**
 * Builds a message string by from a pattern and its arguments.
 * @param locale Locale in which the message should be translated
 * @param specifier format specifier (to be translated)
 * @param parts parts to insert in the format (no translation)
 * @return a message string/*from   w w  w . ja  v a  2s  .  co m*/
 */
private static String buildMessage(final Locale locale, final Localizable specifier, final Object... parts) {
    return (specifier == null) ? ""
            : new MessageFormat(specifier.getLocalizedString(locale), locale).format(parts);
}