| java.lang.Object | |||
| ↳ | com.google.gdata.model.Element | ||
| ↳ | com.google.gdata.model.atom.Source | ||
| ↳ | com.google.gdata.model.atom.Feed | ||
Known Direct Subclasses
|
The Feed class is a base class that represents a generic GData feed object,
based primarily on the data model for an <atom:feed> element.
It is extended to represent OpenSearch RSS channel elements and other gdata
standard elements.
The Feed Class contains all the necessary parsing and generation code for feed data, but can be subclassed to create subtypes that contain convenience APIs for accessing additional elements and entries.
An instance can be initialized by directly initializing its component elements.
Here is the Relax-NG schema that represents an Atom 1.0 feed:
AtomFeed =
element atom:feed {
atomCommonAttributes,
(atomAuthor*
atomCategory*
atomContributor*
atomGenerator?
atomIcon?
atomId
atomLink*
atomLogo?
atomRights?
atomSubtitle?
atomTitle
atomUpdated
extensionElement*),
atomEntry*
}
Because the Feed schema differs from the Source schema only by the
presence of the entries, the Feed class derives its base property model
from the Source class.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Feed.FeedState | The FeedState class provides a simple structure that encapsulates the attributes of an Atom feed that should be shared with a shallow copy if the feed is adapted to a more specific Feed subtypes. | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ITEMS_PER_PAGE | The opensearch:itemsPerPage element. | ||||||||||
| KEY | The key for this element. | ||||||||||
| START_INDEX | The opensearch:startIndex element. | ||||||||||
| TOTAL_RESULTS | The opensearch:totalResults element. | ||||||||||
| XML_BASE | The xml:base attribute. | ||||||||||
| feedState | Basic state for this feed. | ||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.model.atom.Source
| |||||||||||
From class
com.google.gdata.model.Element
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new Feed instance, using default metadata.
| |||||||||||
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new feed instance using the specified metadata.
| |||||||||||
Copy constructor that initializes a new Feed instance to have identical
contents to another instance, using a shared reference to the same
Feed.FeedState. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Adds an entry to this feed.
| |||||||||||
Clears the list of entries on this feed.
| |||||||||||
Creates a new entry for the feed.
| |||||||||||
Creates a new entry for the feed.
| |||||||||||
Gets the property that indicates if it is possible to post new entries to
the feed.
| |||||||||||
Gets a list of entries of a particular kind.
| |||||||||||
Returns the list of entries in this feed
| |||||||||||
Returns the entry post link for the feed.
| |||||||||||
Returns the
ETAG value for this feed. | |||||||||||
Returns the link that provides the URI that can be used to batch operations
to query, insert, update and delete entries on this feed.
| |||||||||||
Gets the number of items that will be returned per page for paged feeds.
| |||||||||||
Returns the
KIND value for this feed. | |||||||||||
Returns the link that provides the URI of next page in a paged feed.
| |||||||||||
Returns the link that provides the URI of previous page in a paged feed.
| |||||||||||
Returns the
FIELDS value for this feed. | |||||||||||
Returns the current representation of the feed by requesting it from the
associated service using the feed's self link.
| |||||||||||
Returns the self link for the feed.
| |||||||||||
Returns that GData
Service instance tassociated with this feed. | |||||||||||
Gets the starting index of the contained entries for paged feeds.
| |||||||||||
Gets the total number of results associated with this feed.
| |||||||||||
Returns the resource version id for this feed.
| |||||||||||
Returns the current xml:base attribute for this feed.
| |||||||||||
Inserts a new Entry into the feed, if the feed is currently associated with
a Service.
| |||||||||||
Registers the metadata for this element.
| |||||||||||
Removes a single entry from this feed.
| |||||||||||
Removes all links.
| |||||||||||
Resolve this element's state against the metadata.
| |||||||||||
Sets the property that indicates if it is possible to post new entries to
the feed.
| |||||||||||
Sets the entries in this feed to the given entries.
| |||||||||||
Sets the
ETAG value for this feed. | |||||||||||
Sets the number of items that will be returned per page for paged feeds.
| |||||||||||
Sets the
KIND value for this feed. | |||||||||||
Sets the
FIELDS value for this feed. | |||||||||||
Sets that GData
Service instance associated with this feed. | |||||||||||
Sets the starting index of the contained entries for paged feeds.
| |||||||||||
Sets the total number of results associated with this feed.
| |||||||||||
Set the resource version id for this feed.
| |||||||||||
Sets the current xml:base attribute for this feed.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns a list of entries matching the given entry key.
| |||||||||||
Narrows this feed using categories with an appropriate kind value.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.model.atom.Source
| |||||||||||
From class
com.google.gdata.model.Element
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gdata.data.IAtom
| |||||||||||
From interface
com.google.gdata.data.IFeed
| |||||||||||
The opensearch:itemsPerPage element.
Basic state for this feed. May be shared across multiple adapted instances associated with the same logical feed.
Constructs a new Feed instance, using default metadata.
Creates a new feed instance using the specified metadata.
| key | The feed key. |
|---|
Copy constructor that initializes a new Feed instance to have identical
contents to another instance, using a shared reference to the same
Feed.FeedState. Subclasses of Feed can use this constructor to
create adaptor instances of a feed that share state with the original but
use a different set of metadata.
| key | |
|---|---|
| source |
Clears the list of entries on this feed.
Creates a new entry for the feed.
| entryKey |
|---|
Gets the property that indicates if it is possible to post new entries to the feed.
Gets a list of entries of a particular kind. Will only return entries that match the expected return class.
| returnClass |
|---|
Returns the ETAG value for this feed. A value of
null indicates the value is unknown.
Returns the link that provides the URI that can be used to batch operations to query, insert, update and delete entries on this feed.
null for none.
Gets the number of items that will be returned per page for paged feeds. A
value of UNDEFINED indicates the page item count is
undefined.
Returns the KIND value for this feed. The kind
attribute may be null if this feed does not have a kind.
Returns the link that provides the URI of next page in a paged feed.
null for none.
Returns the link that provides the URI of previous page in a paged feed.
null for none.
Returns the FIELDS value for this feed. The
fields attribute may be null if this feed contains a full representation.
Returns the current representation of the feed by requesting it from the associated service using the feed's self link.
| IOException | |
|---|---|
| ServiceException |
Gets the starting index of the contained entries for paged feeds. A value
of UNDEFINED indicates the start index is undefined.
Gets the total number of results associated with this feed. The value may
be larger than the number of contained entries for paged feeds. A value of
UNDEFINED indicates the total size is undefined.
Returns the resource version id for this feed. This will be used to generate an etag value on output. This is never set when the Feed has been parsed.
Returns the current xml:base attribute for this feed. The base attribute
may be null if this feed does not have an xml:base.
Inserts a new Entry into the feed, if the feed is currently associated with a Service.
| newEntry |
|---|
| ServiceException | If there is no associated GData service or the service is unable to perform the insertion. |
|---|---|
| UnsupportedOperationException | If insert is not supported for the target feed. |
| IOException | If there is an error communicating with the GData service. |
Registers the metadata for this element.
| registry |
|---|
Removes all links.
Resolve this element's state against the metadata. Accumulates errors in caller's validation context.
| metadata | |
|---|---|
| vc | Validation context |
Sets the property that indicates if it is possible to post new entries to the feed.
| v |
|---|
Sets the entries in this feed to the given entries.
| entries |
|---|
Sets the ETAG value for this feed. A value of
null indicates the value is unknown.
| v |
|---|
Sets the number of items that will be returned per page for paged feeds. A
value of UNDEFINED indicates the page item count is
undefined.
| v |
|---|
Sets the KIND value for this feed. The kind may be set
to null to remove the attribute value.
| v |
|---|
Sets theFIELDS value for this feed. The fields
attribute may be set to null to remove the attribute value.
| v |
|---|
Sets that GData Service instance associated with this feed.
| v |
|---|
Sets the starting index of the contained entries for paged feeds. A value
of UNDEFINED indicates the start index is undefined.
| v |
|---|
Sets the total number of results associated with this feed. The value may
be larger than the number of contained entries for paged feeds. A value of
UNDEFINED indicates the total size is undefined.
| v |
|---|
Set the resource version id for this feed. This will be
used to generate an etag value on output. If null,
the updated time will be used instead to generate an etag.
| v |
|---|
Sets the current xml:base attribute for this feed. The base may be set to
null to remove the attribute value.
| v |
|---|
Returns a list of entries matching the given entry key.
| key |
|---|
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.
| meta | The element metadata to narrow to. |
|---|---|
| vc | Validation context |