예제 #1
0
 @Override
 protected String resolveCodeWithoutArguments(String code, Locale locale, String defaultMessage) {
   CacheTagUtils.tag(Message.class);
   MessageBundleEntry entry = getEntry(code, defaultMessage);
   Message message = getMessage(entry, locale);
   if (message != null) {
     return message.getText();
   }
   return null;
 }
예제 #2
0
 @Override
 protected String getMessageFromParent(String code, Object[] args, Locale locale) {
   String s = super.getMessageFromParent(code, args, locale);
   if (s == null) {
     MessageBundleEntry entry = MessageBundleEntry.loadByBundleAndCode(bundle, code);
     Message message = entry.getDefaultMessage();
     if (message != null) {
       if (args != null) {
         MessageFormat messageFormat = message.getMessageFormat(escapeSingleQuotes);
         if (messageFormat != null) {
           synchronized (messageFormat) {
             return messageFormat.format(args);
           }
         }
       } else {
         return message.getText();
       }
     }
   }
   return s;
 }