org.glassfish.jersey.grizzly2.httpserver.internal.LocalizationMessages Maven / Gradle / Ivy
package org.glassfish.jersey.grizzly2.httpserver.internal;
import java.util.Locale;
import java.util.ResourceBundle;
import org.glassfish.jersey.internal.l10n.Localizable;
import org.glassfish.jersey.internal.l10n.LocalizableMessageFactory;
import org.glassfish.jersey.internal.l10n.LocalizableMessageFactory.ResourceBundleSupplier;
import org.glassfish.jersey.internal.l10n.Localizer;
/**
* Defines string formatting method for each constant in the resource file
*
*/
public final class LocalizationMessages {
private final static String BUNDLE_NAME = "org.glassfish.jersey.grizzly2.httpserver.internal.localization";
private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new LocalizationMessages.BundleSupplier());
private final static Localizer LOCALIZER = new Localizer();
public static Localizable localizableEXCEPTION_SENDING_ERROR_RESPONSE(Object arg0, Object arg1) {
return MESSAGE_FACTORY.getMessage("exception.sending.error.response", arg0, arg1);
}
/**
* I/O exception occurred while sending "{0}/{1}" error response.
*
*/
public static String EXCEPTION_SENDING_ERROR_RESPONSE(Object arg0, Object arg1) {
return LOCALIZER.localize(localizableEXCEPTION_SENDING_ERROR_RESPONSE(arg0, arg1));
}
public static Localizable localizableFAILED_TO_START_SERVER(Object arg0) {
return MESSAGE_FACTORY.getMessage("failed.to.start.server", arg0);
}
/**
* Failed to start Grizzly HTTP server: {0}
*
*/
public static String FAILED_TO_START_SERVER(Object arg0) {
return LOCALIZER.localize(localizableFAILED_TO_START_SERVER(arg0));
}
private static class BundleSupplier
implements ResourceBundleSupplier
{
public ResourceBundle getResourceBundle(Locale locale) {
return ResourceBundle.getBundle(BUNDLE_NAME, locale);
}
}
}