
org.glassfish.jersey.jetty.http2.LocalizationMessages Maven / Gradle / Ivy
package org.glassfish.jersey.jetty.http2;
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.jetty.http2.localization";
private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new LocalizationMessages.BundleSupplier());
private final static Localizer LOCALIZER = new Localizer();
public static Localizable localizableERROR_WHEN_CREATING_SERVER() {
return MESSAGE_FACTORY.getMessage("error.when.creating.server");
}
/**
* Exception thrown when trying to create jetty server.
*
*/
public static String ERROR_WHEN_CREATING_SERVER() {
return LOCALIZER.localize(localizableERROR_WHEN_CREATING_SERVER());
}
public static Localizable localizableNOT_SUPPORTED() {
return MESSAGE_FACTORY.getMessage("not.supported");
}
/**
* Jetty container is not supported on JDK version less than 11.
*
*/
public static String NOT_SUPPORTED() {
return LOCALIZER.localize(localizableNOT_SUPPORTED());
}
private static class BundleSupplier
implements ResourceBundleSupplier
{
public ResourceBundle getResourceBundle(Locale locale) {
return ResourceBundle.getBundle(BUNDLE_NAME, locale);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy