MessageSourceResourceBundle.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * This implementation checks whether the target MessageSource can resolve
 * a message for the given key, translating {@code NoSuchMessageException}
 * accordingly. In contrast to ResourceBundle's default implementation in
 * JDK 1.6, this does not rely on the capability to enumerate message keys.
 */
@Override
public boolean containsKey(String key) {
    try {
        this.messageSource.getMessage(key, null, this.locale);
        return true;
    }
    catch (NoSuchMessageException ex) {
        return false;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号