String href = item.getLink();
if (href == null) {
href = key.toString();
}
Link link = new Link();
link.setRel("edit");
link.setHref(href);
feedEntry.getOtherLinks().add(link);
link = new Link();
link.setRel("alternate");
link.setHref(href);
feedEntry.getAlternateLinks().add(link);
Date date = item.getDate();
if (date == null) {
date = new Date();
}
feedEntry.setCreated(date);
return feedEntry;
} else if (data != null) {
Entry feedEntry = new Entry();
feedEntry.setId(key.toString());
feedEntry.setTitle("item");
// Convert the item to XML
String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
Content content = new Content();
content.setType("text/xml");
content.setValue(value);
List<Content> contents = new ArrayList<Content>();
contents.add(content);
feedEntry.setContents(contents);
Link link = new Link();
link.setRel("edit");
link.setHref(key.toString());
feedEntry.getOtherLinks().add(link);
link = new Link();
link.setRel("alternate");
link.setHref(key.toString());
feedEntry.getAlternateLinks().add(link);
feedEntry.setCreated(new Date());
return feedEntry;
} else {