
br.com.caelum.vraptor.boilerplate.i18n.MessageBundleProducer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vraptor-boilerplate-utils Show documentation
Show all versions of vraptor-boilerplate-utils Show documentation
VRaptor Boilerplate utility classes.
The newest version!
package br.com.caelum.vraptor.boilerplate.i18n;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
/**
* Basic implementation of MessageBundle injection. This producer
* can implement more complex logic to determine the bundle name and locale.
* @author Renato R. R. de Oliveira
*
*/
@RequestScoped
public class MessageBundleProducer {
@Inject private MessageBundleConfig config;
private MessageBundle bundle;
@Produces
public MessageBundle getInstance() {
if (this.bundle == null) {
this.bundle = new MessageBundle(this.config);
}
return this.bundle;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy