public void addAuthors(List<Person> v) { for (Person p : v) { addAuthor(p); } }
public void addContributors(List<Person> v) { for (Person p : v) { addContributor(p); } }
public void addCategory(Category v) { addElement(Category.KEY, v); }
@Override public boolean startElement(XmlWriter xw, Element parent, Element e, ElementMetadata<?, ?> metadata) throws IOException { boolean isIcon = e.getElementId().equals(Source.ICON.getId()); boolean isLogo = e.getElementId().equals(Source.LOGO.getId()); if ((!isIcon && !isLogo) || !(parent instanceof Source)) { return super.startElement(xw, parent, e, metadata); } Source source = (Source) parent; if (isIcon && source.hasElement(Source.LOGO)) { // atom:logo takes precedence return false; } xw.startElement(Namespaces.rssNs, "image", null, null); xw.simpleElement(Namespaces.rssNs, "url", null, String.valueOf(e.getTextValue())); TextContent title = source.getTitle(); if (title != null) { xw.simpleElement(Namespaces.rssNs, "title", null, title.getPlainText()); } Link htmlLink = source.getHtmlLink(); if (htmlLink != null) { xw.simpleElement(Namespaces.rssNs, "link", null, htmlLink.getHref()); } xw.endElement(Namespaces.rssNs, "image"); return false; }
/** * Gets icon URI associated with source. * * @return icon URI */ public URI getIconUri() { return getElementValue(ICON); }
public Generator getGenerator() { return getElement(Generator.KEY); }
@SuppressWarnings("unchecked") public List<Person> getContributors() { return (List<Person>) (List<?>) getElements(Contributor.KEY); }
public Link addLink(String rel, String type, String href) { try { Link link = new Link(rel, type, new URI(href)); addLink(link); return link; } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
public Set<Category> getCategories() { return getElementSet(Category.KEY); }
/** * Gets icon URI associated with source. * * @deprecated Use {@link #getIconUri()} instead. * * @return icon URI */ @Deprecated public String getIcon() { URI uri = getIconUri(); if (uri == null) { return null; } return uri.toString(); }
@Override public boolean startElement(XmlWriter xw, Element parent, Element e, ElementMetadata<?, ?> metadata) throws IOException { boolean isIcon = e.getElementId().equals(Source.ICON.getId()); boolean isLogo = e.getElementId().equals(Source.LOGO.getId()); if ((!isIcon && !isLogo) || !(parent instanceof Source)) { return super.startElement(xw, parent, e, metadata); } Source source = (Source) parent; if (isIcon && source.hasElement(Source.LOGO)) { // atom:logo takes precedence return false; } xw.startElement(Namespaces.rssNs, "image", null, null); xw.simpleElement(Namespaces.rssNs, "url", null, String.valueOf(e.getTextValue())); TextContent title = source.getTitle(); if (title != null) { xw.simpleElement(Namespaces.rssNs, "title", null, title.getPlainText()); } Link htmlLink = source.getHtmlLink(); if (htmlLink != null) { xw.simpleElement(Namespaces.rssNs, "link", null, htmlLink.getHref()); } xw.endElement(Namespaces.rssNs, "image"); return false; }
/** * Gets icon URI associated with source. * * @return icon URI */ public URI getIconUri() { return getElementValue(ICON); }
public TextContent getTitle() { return getElement(TITLE); }
@SuppressWarnings("unchecked") public List<Person> getAuthors() { return (List<Person>) (List<?>) getElements(Author.KEY); }
public Link addLink(String rel, String type, String href) { try { Link link = new Link(rel, type, new URI(href)); addLink(link); return link; } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
public Set<Category> getCategories() { return getElementSet(Category.KEY); }
/** * Gets icon URI associated with source. * * @deprecated Use {@link #getIconUri()} instead. * * @return icon URI */ @Deprecated public String getIcon() { URI uri = getIconUri(); if (uri == null) { return null; } return uri.toString(); }
@Override public boolean startElement(XmlWriter xw, Element parent, Element e, ElementMetadata<?, ?> metadata) throws IOException { boolean isIcon = e.getElementId().equals(Source.ICON.getId()); boolean isLogo = e.getElementId().equals(Source.LOGO.getId()); if ((!isIcon && !isLogo) || !(parent instanceof Source)) { return super.startElement(xw, parent, e, metadata); } Source source = (Source) parent; if (isIcon && source.hasElement(Source.LOGO)) { // atom:logo takes precedence return false; } xw.startElement(Namespaces.rssNs, "image", null, null); xw.simpleElement(Namespaces.rssNs, "url", null, String.valueOf(e.getTextValue())); TextContent title = source.getTitle(); if (title != null) { xw.simpleElement(Namespaces.rssNs, "title", null, title.getPlainText()); } Link htmlLink = source.getHtmlLink(); if (htmlLink != null) { xw.simpleElement(Namespaces.rssNs, "link", null, htmlLink.getHref()); } xw.endElement(Namespaces.rssNs, "image"); return false; }
public void addAuthor(Person v) { addElement(Author.KEY, v); }
/** * Gets logo URI associated with source. * * @return logo URI */ public URI getLogoUri() { return getElementValue(LOGO); }