示例#1
0
 public String getContent() {
   for (NewsContent newsContent : newsContents) {
     if (newsContent.getLang().getSymbol().equals(lang)) {
       return newsContent.getContent();
     }
   }
   return null;
 }
示例#2
0
 private NewsContent getNewsContent() {
   for (NewsContent newsContent : newsContents) {
     if (newsContent.getLang().getSymbol().equals(lang)) {
       return newsContent;
     }
   }
   NewsContent newsContent = new NewsContent();
   newsContent.setLang(Lang.valueOf(lang));
   newsContent.setNews(this);
   newsContents.add(newsContent);
   return newsContent;
 }
示例#3
0
 // setContent方法依赖于setLang方法先执行
 public void setContent(String content) {
   log.info("设置内容");
   log.info("模型语言:" + lang);
   NewsContent newsContent = getNewsContent();
   newsContent.setContent(content);
 }
示例#4
0
 // setTitle方法依赖于setLang方法先执行
 public void setTitle(String title) {
   log.info("设置标题");
   log.info("模型语言:" + lang);
   NewsContent newsContent = getNewsContent();
   newsContent.setTitle(title);
 }