예제 #1
0
  public Messages() {
    this.bundle = ResourceBundle.getBundle(Default.BUNDLE_NAME.toString(), Locale.getDefault());

    defaults.put(Key.FORM_REQUIRED.toString(), Validation.REQUIRED.toString());
    defaults.put(Key.FORM_MIN.toString(), Validation.MIN.toString());
    defaults.put(Key.FORM_MAX.toString(), Validation.MAX.toString());
    defaults.put(Key.FORM_EXACT_MATCH.toString(), Validation.EXACT_MATCH.toString());
    defaults.put(Key.FORM_MATCH.toString(), Validation.MATCH.toString());
    defaults.put(Key.FORM_EMAIL.toString(), Validation.EMAIL.toString());
    defaults.put(Key.FORM_IPV4.toString(), Validation.IPV4.toString());
    defaults.put(Key.FORM_IPV6.toString(), Validation.IPV6.toString());
    defaults.put(Key.FORM_RANGE.toString(), Validation.RANGE.toString());
    defaults.put(Key.FORM_URL.toString(), Validation.URL.toString());
  }
예제 #2
0
 /** Refreshes the resource bundle by reloading the bundle with the default locale */
 public void reload() {
   if (!Locale.getDefault().equals(this.locale)) {
     this.locale = Locale.getDefault();
     this.bundle = ResourceBundle.getBundle(Default.BUNDLE_NAME.toString(), Locale.getDefault());
   }
 }