protected SyndEntry createSyndEntry(Item item) {
    SyndEntry syndEntry = new SyndEntryImpl();

    syndEntry.setModules(ModuleUtils.cloneModules(item.getModules()));

    if (((List) item.getForeignMarkup()).size() > 0) {
      syndEntry.setForeignMarkup(item.getForeignMarkup());
    }

    syndEntry.setUri(item.getUri());
    syndEntry.setLink(item.getLink());
    syndEntry.setTitle(item.getTitle());
    if (item.getDescription() != null) {
      SyndContent description = new SyndContentImpl();
      description.setValue(item.getDescription().getValue());
      syndEntry.setDescription(description);
    }
    if (item.getAuthor() != null) syndEntry.setAuthor(item.getAuthor());
    if (item.getPubDate() != null) syndEntry.setPublishedDate(item.getPubDate());
    syndEntry.setCategories(item.getCategories());
    return syndEntry;
  }
예제 #2
0
 protected Item parseItem(Element rssRoot, Element eItem) {
   Item item = super.parseItem(rssRoot, eItem);
   Element e = eItem.getChild("pubDate", getRSSNamespace());
   if (e != null) {
     item.setPubDate(DateParser.parseDate(e.getText()));
   }
   e = eItem.getChild("expirationDate", getRSSNamespace());
   if (e != null) {
     item.setExpirationDate(DateParser.parseDate(e.getText()));
   }
   e = eItem.getChild("description", getRSSNamespace());
   if (e != null) {
     String type = e.getAttributeValue("type");
     if (type != null) {
       item.getDescription().setType(type);
     }
   }
   return item;
 }
 protected SyndEntry createSyndEntry(Item item) {
   SyndEntry syndEntry = super.createSyndEntry(item);
   Description desc = item.getDescription();
   if (desc != null) {
     SyndContent descContent = new SyndContentImpl();
     descContent.setType(desc.getType());
     descContent.setValue(desc.getValue());
     syndEntry.setDescription(descContent);
   }
   Content cont = item.getContent();
   if (cont != null) {
     SyndContent content = new SyndContentImpl();
     content.setType(cont.getType());
     content.setValue(cont.getValue());
     List syndContents = new ArrayList();
     syndContents.add(content);
     syndEntry.setContents(syndContents);
   }
   return syndEntry;
 }