Examples of SafeResourceBundle


Examples of br.com.caelum.vraptor.core.SafeResourceBundle

    private final List<Message> errors = new ArrayList<Message>();
  private final ResourceBundle bundle;

    public Validations(ResourceBundle bundle) {
    this.bundle = new SafeResourceBundle(bundle);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.core.SafeResourceBundle

    private final List<Message> errors = new ArrayList<Message>();
  private final ResourceBundle bundle;

    public Validations(ResourceBundle bundle) {
    this.bundle = new SafeResourceBundle(bundle);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.core.SafeResourceBundle

    public Validations(ResourceBundle bundle) {
    this.bundle = Suppliers.ofInstance(bundle);
  }

    public Validations() {
      this(new SafeResourceBundle(ResourceBundle.getBundle("messages"), true));
    }
View Full Code Here

Examples of br.com.caelum.vraptor.core.SafeResourceBundle

    public List<Message> getErrors(final Supplier<ResourceBundle> bundle) {
      final Supplier<ResourceBundle> oldBundle = this.bundle;
      this.bundle = new Supplier<ResourceBundle>() {
      public ResourceBundle get() {
        if (isDefaultBundle(oldBundle)) {
          return new SafeResourceBundle(bundle.get());
        } else {
          return new FallbackResourceBundle(oldBundle.get(), bundle.get());
        }
      }
    };
View Full Code Here

Examples of br.com.caelum.vraptor.core.SafeResourceBundle

*
*/
public class MockLocalization implements Localization {

  public ResourceBundle getBundle() {
    return new SafeResourceBundle(new EmptyBundle());
  }
View Full Code Here

Examples of br.com.caelum.vraptor.core.SafeResourceBundle

public class Resources {

  public String getText(String key) {
    I18nMessage message = new I18nMessage("default",key);   
    message.setBundle(new SafeResourceBundle(ResourceBundle.getBundle("messages"), true))
    return message.getMessage();
 
View Full Code Here

Examples of br.com.caelum.vraptor.util.SafeResourceBundle

  @Produces
  public ResourceBundle getBundle() {
    Object bundle = findByKey(Config.FMT_LOCALIZATION_CONTEXT);
    ResourceBundle unsafe = extractUnsafeBundle(bundle);

    return new SafeResourceBundle(unsafe);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.util.SafeResourceBundle

  @Produces
  public ResourceBundle getBundle() {
    Object bundle = findByKey(Config.FMT_LOCALIZATION_CONTEXT);
    ResourceBundle unsafe = extractUnsafeBundle(bundle);

    return new SafeResourceBundle(unsafe);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.util.SafeResourceBundle

  private SafeResourceBundle bundle;

  @Before
  public void setUp() throws Exception {
    PropertyResourceBundle delegate = new PropertyResourceBundle(new ByteArrayInputStream("abc=def".getBytes()));
    bundle = new SafeResourceBundle(delegate);
  }
View Full Code Here

Examples of br.com.caelum.vraptor.util.SafeResourceBundle

  private @Mock MyComponent instance;
  private DefaultValidator validator;

  @Before
  public void setup() {
    ResourceBundle bundle = new SafeResourceBundle(ResourceBundle.getBundle("messages"));

    ValidatorFactory validatorFactory = javax.validation.Validation.buildDefaultValidatorFactory();
    javax.validation.Validator bvalidator = validatorFactory.getValidator();
    MessageInterpolator interpolator = validatorFactory.getMessageInterpolator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.