String href = item.getLink();
if (href == null) {
href = key.toString();
}
SyndLink link = new SyndLinkImpl();
link.setRel("edit");
link.setHref(href);
feedEntry.getLinks().add(link);
link = new SyndLinkImpl();
link.setRel("alternate");
link.setHref(href);
feedEntry.getLinks().add(link);
Date date = item.getDate();
if (date == null) {
date = new Date();
}
feedEntry.setPublishedDate(date);
return feedEntry;
} else if (data != null) {
SyndEntry feedEntry = new SyndEntryImpl();
feedEntry.setUri(key.toString());
feedEntry.setTitle("item");
// Convert the item to XML
String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
SyndContent content = new SyndContentImpl();
content.setType("text/xml");
content.setValue(value);
List<SyndContent> contents = new ArrayList<SyndContent>();
contents.add(content);
feedEntry.setContents(contents);
SyndLink link = new SyndLinkImpl();
link.setRel("edit");
link.setHref(key.toString());
feedEntry.getLinks().add(link);
link = new SyndLinkImpl();
link.setRel("alternate");
link.setHref(key.toString());
feedEntry.getLinks().add(link);
feedEntry.setPublishedDate(new Date());
return feedEntry;
} else {