de.jformchecker.adapter.message.ResourceBundleMessageSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jformchecker-integration Show documentation
Show all versions of jformchecker-integration Show documentation
jFormchecker integration utils that connects it to frameworks/APIs
package de.jformchecker.adapter.message;
import java.util.ResourceBundle;
import de.jformchecker.message.MessageSource;
public class ResourceBundleMessageSource implements MessageSource {
ResourceBundle bundle;
public ResourceBundleMessageSource(ResourceBundle bundle) {
this.bundle = bundle;
}
@Override
public String getMessage(String key) {
if (this.bundle.containsKey(key)) {
return bundle.getString(key);
} else {
System.err.println("bundle key is missing: " + key);
return "";
}
}
}