@Test public void read() throws IOException { InputStream is = getClass().getResourceAsStream("atom.xml"); MockHttpInputMessage inputMessage = new MockHttpInputMessage(is); inputMessage.getHeaders().setContentType(new MediaType("application", "atom+xml", StandardCharsets.UTF_8)); Feed result = converter.read(Feed.class, inputMessage); assertEquals("title", result.getTitle()); assertEquals("subtitle", result.getSubtitle().getValue()); List<?> entries = result.getEntries(); assertEquals(2, entries.size()); Entry entry1 = (Entry) entries.get(0); assertEquals("id1", entry1.getId()); assertEquals("title1", entry1.getTitle()); Entry entry2 = (Entry) entries.get(1); assertEquals("id2", entry2.getId()); assertEquals("title2", entry2.getTitle()); }
/** * Returns the feed title. * <p> * * @return the feed title, <b>null</b> if none. * */ public String getTitle() { if (title != null) { return title.getValue(); } return null; }
/** * Returns the feed title. * <p> * * @return the feed title, <b>null</b> if none. * */ public String getTitle() { if (title != null) { return title.getValue(); } return null; }
/** * Returns the entry title. * <p> * * @return the entry title, <b>null</b> if none. * */ public String getTitle() { if (title != null) { return title.getValue(); } return null; }
/** * Returns the entry title. * <p> * * @return the entry title, <b>null</b> if none. * */ public String getTitle() { if (title != null) { return title.getValue(); } return null; }
private void serializeContents(ObjectNode root, JsonNodeFactory factory, List contents) { if (contents == null || contents.size() == 0) { return; } ArrayNode contentsArray = factory.arrayNode(); for (Object obj : contents) { ObjectNode content = factory.objectNode(); if (obj instanceof com.rometools.rome.feed.rss.Content) { com.rometools.rome.feed.rss.Content rssContent = (com.rometools.rome.feed.rss.Content) obj; content.put("type", rssContent.getType()); content.put("value", rssContent.getValue()); } if (obj instanceof com.rometools.rome.feed.atom.Content) { com.rometools.rome.feed.atom.Content atomContent = (com.rometools.rome.feed.atom.Content) obj; content.put("type", atomContent.getType()); content.put("value", atomContent.getValue()); content.put("mode", atomContent.getMode()); content.put("src", atomContent.getSrc()); } contentsArray.add(content); } root.put("contents", contentsArray); }
protected SyndContent createSyndContent(final Content content) { final SyndContent sContent = new SyndContentImpl(); sContent.setType(content.getType()); sContent.setValue(content.getValue()); return sContent; }
protected SyndContent createSyndContent(final Content content) { final SyndContent sContent = new SyndContentImpl(); sContent.setType(content.getType()); sContent.setValue(content.getValue()); return sContent; }
final String value = content.getValue(); if (value != null) {
Date lastUpdateInFeed = null; for (Entry entry : feed.getEntries()) { String applicationNumber = entry.getSummary().getValue(); if ((lastModified == null) || (entry.getUpdated().after(lastModified))) { log.info(applicationNumber + " is new, updating the status");
final String value = content.getValue(); if (value != null) {
ObjectMapper mapper = new ObjectMapper(); for (Entry entry : feed.getEntries()) { String ratingAsJson = entry.getSummary().getValue(); if ((lastModified == null) || (entry.getUpdated().after(lastModified))) { log.info(entry.getTitle() + " is new, processing");
final String value = content.getValue(); if (value != null) {
protected Element generateTagLineElement(final Content tagline) { final Element taglineElement = new Element("subtitle", getFeedNamespace()); final String type = tagline.getType(); if (type != null) { final Attribute typeAttribute = new Attribute("type", type); taglineElement.setAttribute(typeAttribute); } final String value = tagline.getValue(); if (value != null) { taglineElement.addContent(value); } return taglineElement; }
protected Element generateTagLineElement(final Content tagline) { final Element taglineElement = new Element("tagline", getFeedNamespace()); final String type = tagline.getType(); if (type != null) { final Attribute typeAttribute = new Attribute("type", type); taglineElement.setAttribute(typeAttribute); } final String value = tagline.getValue(); if (value != null) { taglineElement.addContent(value); } return taglineElement; }
protected Element generateTagLineElement(final Content tagline) { final Element taglineElement = new Element("subtitle", getFeedNamespace()); final String type = tagline.getType(); if (type != null) { final Attribute typeAttribute = new Attribute("type", type); taglineElement.setAttribute(typeAttribute); } final String value = tagline.getValue(); if (value != null) { taglineElement.addContent(value); } return taglineElement; }
protected Element generateTagLineElement(final Content tagline) { final Element taglineElement = new Element("tagline", getFeedNamespace()); final String type = tagline.getType(); if (type != null) { final Attribute typeAttribute = new Attribute("type", type); taglineElement.setAttribute(typeAttribute); } final String value = tagline.getValue(); if (value != null) { taglineElement.addContent(value); } return taglineElement; }
final String value = content.getValue(); if (value != null) {
content = new BlogEntry.Content(romeContent.getValue()); content.setType(romeContent.getType()); content.setSrc(romeContent.getSrc());
syndFeed.setDescription(tagline.getValue());