org.glassfish.jersey.inject.cdi.se.LocalizationMessages Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jersey-cdi2-se Show documentation
Show all versions of jersey-cdi2-se Show documentation
CDI 4 SE InjectionManager implementation
package org.glassfish.jersey.inject.cdi.se;
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 static final String BUNDLE_NAME = "org.glassfish.jersey.inject.cdi.se.localization";
private static final LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new LocalizationMessages.BundleSupplier());
private static final Localizer LOCALIZER = new Localizer();
private LocalizationMessages() {
}
public static Localizable localizableCDI_2_PROVIDER_NOT_REGISTRABLE(Object arg0) {
return MESSAGE_FACTORY.getMessage("cdi2.provider.not.registrable", arg0);
}
/**
* Provider registered to CdiInjectionManager cannot be process because of incompatible type: {0}.
*
*/
public static String CDI_2_PROVIDER_NOT_REGISTRABLE(Object arg0) {
return LOCALIZER.localize(localizableCDI_2_PROVIDER_NOT_REGISTRABLE(arg0));
}
private static class BundleSupplier
implements ResourceBundleSupplier
{
public ResourceBundle getResourceBundle(Locale locale) {
return ResourceBundle.getBundle(BUNDLE_NAME, locale);
}
}
}