/** * Sets that GData {@link Service} instance associated with this feed. */ public void setService(Service v) { feedState.service = v; // Propagate service information to nested entries for (Entry entry : getEntries()) { entry.setService(v); } }
/** * Assumes the <content> element's contents are plain-text and returns its * value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException If the content element is not a text type. */ public String getPlainTextContent() { TextContent content = getTextContent(); return (content == null) ? null : content.getPlainText(); }
@Override public Element resolve(ElementMetadata<?, ?> metadata, ValidationContext vc) { // Fix "setCanPost" based on the existence of an entry post link. feedState.canPost = getEntryPostLink() != null; // Continue parent resolution. return super.resolve(metadata, vc); }
public Generator setGenerator(String version, String uri, String name) { Generator gen = new Generator(); gen.setVersion(version); gen.setUri(uri); gen.setName(name); setGenerator(gen); return gen; }
/** * Narrows this feed using categories with an appropriate kind value. * This will loop through the categories, checking if they represent kinds, * and adapting the feed to that kind if an appropriate adaptation was * found. This will return the most specific subtype of the narrowed type. */ @Override protected Element narrow(ElementMetadata<?,?> meta, ValidationContext vc) { String kind = Kinds.getElementKind(this); if (kind != null) { return adapt(this, meta, kind); } return super.narrow(meta, vc); }
/** Retrieves the resource edit link. */ public Link getEditLink() { Link editLink = getLink(Link.Rel.ENTRY_EDIT, Link.Type.ATOM); return editLink; }
/** * Returns the {@link GdAttributes#KIND} value for this feed. The kind * attribute may be null if this feed does not have a kind. */ public String getKind() { return getAttributeValue(GdAttributes.KIND); }
/** * Creates a new entry for the feed. */ public Entry createEntry() { return createEntry(Entry.KEY); }
/** * Returns the link that provides the URI of previous page in a paged feed. * * @return Link that provides the URI of previous page in a paged feed or * {@code null} for none. */ public Link getPreviousLink() { return getLink(Link.Rel.PREVIOUS, Link.Type.ATOM); }
/** * Gets the app:control tag. * * @return pub control tag or null if unset */ public Control getControl() { return getElement(Control.KEY); }
public Generator setGenerator(String version, String uri, String name) { Generator gen = new Generator(); gen.setVersion(version); gen.setUri(uri); gen.setName(name); setGenerator(gen); return gen; }
/** * Narrows this feed using categories with an appropriate kind value. * This will loop through the categories, checking if they represent kinds, * and adapting the feed to that kind if an appropriate adaptation was * found. This will return the most specific subtype of the narrowed type. */ @Override protected Element narrow(ElementMetadata<?,?> meta, ValidationContext vc) { String kind = Kinds.getElementKind(this); if (kind != null) { return adapt(this, meta, kind); } return super.narrow(meta, vc); }
/** * Sets that GData {@link Service} instance associated with this feed. */ public void setService(Service v) { feedState.service = v; // Propagate service information to nested entries for (Entry entry : getEntries()) { entry.setService(v); } }
/** * Assumes the <content> element's contents are plain-text and returns its * value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException If the content element is not a text type. */ public String getPlainTextContent() { TextContent content = getTextContent(); return (content == null) ? null : content.getPlainText(); }
@Override public Element resolve(ElementMetadata<?, ?> metadata, ValidationContext vc) { // Fix "setCanPost" based on the existence of an entry post link. feedState.canPost = getEntryPostLink() != null; // Continue parent resolution. return super.resolve(metadata, vc); }
/** Retrieves the media resource edit link. */ public Link getMediaEditLink() { Link mediaLink = getLink(Link.Rel.MEDIA_EDIT, null); return mediaLink; }
public Generator setGenerator(String version, String uri, String name) { Generator gen = new Generator(); gen.setVersion(version); gen.setUri(uri); gen.setName(name); setGenerator(gen); return gen; }
/** * Sets that GData {@link Service} instance associated with this feed. */ public void setService(Service v) { feedState.service = v; // Propagate service information to nested entries for (Entry entry : getEntries()) { entry.setService(v); } }
/** * Assumes the <content> element's contents are plain-text and * returns its value as a string * * @return A string containing the plain-text value of the content tag. * * @throws IllegalStateException * If the content element is not a text type. */ public String getPlainTextContent() { TextContent content = getTextContent(); return (content == null) ? null : content.getPlainText(); }
@Override public Element resolve(ElementMetadata<?, ?> metadata, ValidationContext vc) { // Fix "setCanPost" based on the existence of an entry post link. feedState.canPost = getEntryPostLink() != null; // Continue parent resolution. return super.resolve(metadata, vc); }