Skip to content

ResourceBundle

H90 edited this page May 4, 2021 · 11 revisions

Call the withMessages(Map<String, String>) method on the generated parser, with a map created from the bundle:

Map<String, String> toMap(ResourceBundle bundle) {
  return Collections.list(bundle.getKeys()).stream()
    .collect(Collectors.toMap(Function.identity(), bundle::getString));
}
Clone this wiki locally