| java.lang.Object | ||||
| ↳ | com.google.gdata.data.AbstractExtension | |||
| ↳ | com.google.gdata.data.ExtensionPoint | |||
| ↳ | com.google.gdata.data.Source | |||
| ↳ | com.google.gdata.data.BaseFeed<F extends com.google.gdata.data.BaseFeed, E extends com.google.gdata.data.BaseEntry> | |||
Known Direct Subclasses
AbPageVariationFeed,
AccountFeed,
AclFeed,
ActivityFeed,
ArchiveFeed,
AttendeeFeed,
BaseEventFeed<F extends BaseEventFeed<F, E extends BaseEventEntry<E>>, E>,
BaseHealthFeed<F extends BaseHealthFeed, E extends BaseHealthEntry>,
BlogCommentFeed,
BlogFeed,
BlogPostFeed,
CalendarFeed,
CaptionTrackFeed,
CellFeed,
ChangelogFeed,
and
59 others.
|
Known Indirect Subclasses
|
The BaseFeed class is an abstract 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 also supports generalized
extensibility using a defined ExtensionProfile and/or by stored
extended data as an XmlBlob.
The BaseFeedClass is a generic class that is parameterized by the type of Entry that will be contained within the feed. The base class contains all the necessary parsing and generation code for feed extension data, but can be subclassed to create subtypes that contain convenience APIs for accessing extension elements and entries.
An instance can be initialized by parsing an Atom 1.0 feed from a Reader or by directly initializing its component elements. It can generate an XML representation of the feed to an XmlWriter in either Atom 1.0 or RSS 2.0 format.
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 and parsing/generation implementations from the Source class.
The BaseFeed class implements the Kind.Adaptable interface, meaning
it is possible to create new Kind.Adaptor subtypes that defines
a custom extension model (and associated convenience APIs) for a BaseFeed
subtypes that use Atom/RSS extensions to extend the content model for a
particular type of data.
An Kind.Adaptor subclass of BaseFeed should do the following:
Kind.Term annotation on the class declaration that
defines the Category term value for the GData kind handled by the
adaptor.Class and BaseFeed
parameter as an argument that is used when adapting a generic feed type to
a more specific one.declareExtensions(ExtensionProfile)
method and use it to declare the extension model for the adapted instance
within the profile passed as a parameter. This is used to auto-extend
an extension profile when kind Category tags are found during parsing of
content.ExtensionPoint methods to
store/retrieve the extension data.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| BaseFeed.FeedHandler | <atom:feed> parser. |
||||||||||
| BaseFeed.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 BaseFeed
Kind.Adaptor subtypes. |
||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| entries | Feed entries. | ||||||||||
| entryClass | Class used to construct new entry instance, initialized at construction. | ||||||||||
| feedState | Basic state for this feed. | ||||||||||
| rssHeaderAttrs | Headers that are added to all RSS output | ||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.data.Source
| |||||||||||
From class
com.google.gdata.data.ExtensionPoint
| |||||||||||
From class
com.google.gdata.data.AbstractExtension
| |||||||||||
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Copy constructor that initializes a new BaseFeed instance to have
identical contents to another instance, using a shared reference to
the same
BaseFeed.FeedState. | |||||||||||
Copy constructor that initializes a new BaseFeed instance to have
identical contents to another instance, using a shared reference to
the same
BaseFeed.FeedState. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Associates a new
Kind.Adaptor with this Adaptable instance. | |||||||||||
Creates a new entry for the feed.
| |||||||||||
Declares the set of expected Extension types for an ExtensionPoint within
the target extension profile.
The implementation of this method for BaseFeed will declare any extensions associated with the contained entry type. | |||||||||||
Generates an XML representation for the extension.
| |||||||||||
Generates XML in the Atom format.
| |||||||||||
Closes everything that was opened by
generateFeedStart(ExtensionProfile, XmlWriter, Collection. | |||||||||||
Generates everything that's in the feed up to and not including the
entries.
| |||||||||||
Generates XML in the RSS format.
| |||||||||||
Locates and returns the most specific
Kind.Adaptor feed
subtype for this feed. | |||||||||||
Returns the collection of
Kind.Adaptor instances associated with the
this Adaptable instance. | |||||||||||
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 current entity tag 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.
| |||||||||||
The default implementation uses the
AbstractExtension.AttributesHandler to handle
parsing the extension. | |||||||||||
Gets the number of items that will be returned per page for paged feeds.
| |||||||||||
Returns the current gd:kind attribute 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 current fields selection for this partial 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 associated 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 entity version for this feed.
| |||||||||||
Inserts a new Entry into the feed, if the feed is currently
associated with a Service.
| |||||||||||
Parses XML in the Atom format from a parser-defined content source.
| |||||||||||
Parses XML in the Atom format.
| |||||||||||
Parses XML in the Atom format.
| |||||||||||
This method provides the base implementation of feed reading using either
static or dynamic typing.
| |||||||||||
Reads a feed representation from the provided
ParseSource. | |||||||||||
Sets the property that indicates if it is possible to post new entries
to the feed.
| |||||||||||
Sets the list to use for storing the entry list
| |||||||||||
Sets the current entity tag value for this feed.
| |||||||||||
Sets the number of items that will be returned per page for paged feeds.
| |||||||||||
Sets the current gd:kind attribute value for this feed.
| |||||||||||
Sets the current fields selection for this partial 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.
| |||||||||||
Sets the entity version for this feed.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Called to visit all children of this extension point.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gdata.data.Source
| |||||||||||
From class
com.google.gdata.data.ExtensionPoint
| |||||||||||
From class
com.google.gdata.data.AbstractExtension
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gdata.data.Extension
| |||||||||||
From interface
com.google.gdata.data.IAtom
| |||||||||||
From interface
com.google.gdata.data.IFeed
| |||||||||||
From interface
com.google.gdata.data.Kind.Adaptable
| |||||||||||
From interface
com.google.gdata.data.Kind.Adaptor
| |||||||||||
Class used to construct new entry instance, initialized at construction.
Basic state for this feed. May be shared across multiple adapted instances associated with the same logical feed.
Headers that are added to all RSS output
Copy constructor that initializes a new BaseFeed instance to have
identical contents to another instance, using a shared reference to
the same BaseFeed.FeedState. Kind.Adaptor subclasses
of BaseFeed can use this constructor to create adaptor
instances of an entry that share state with the original.
| entryClass | Class used to construct new Entry instances for the Feed. |
|---|
Copy constructor that initializes a new BaseFeed instance to have
identical contents to another instance, using a shared reference to
the same BaseFeed.FeedState. Kind.Adaptor subclasses
of BaseFeed can use this constructor to create adaptor
instances of a feed that share state with the original.
| entryClass | |
|---|---|
| sourceFeed |
Associates a new Kind.Adaptor with this Adaptable instance.
| adaptor |
|---|
Creates a new entry for the feed.
Declares the set of expected Extension types for an ExtensionPoint within the target extension profile. The base implementation does not declare any extensions, but can be overridden by specific types of ExtensionPoints that always contain a well-defined set of extensions.
The implementation of this method for BaseFeed will declare any extensions associated with the contained entry type.
| extProfile | The ExtensionProfile to initialize. |
|---|
Generates an XML representation for the extension.
| w | XML writer |
|---|---|
| p | Extension profile |
| IOException |
|---|
Generates XML in the Atom format.
| w | Output writer. |
|---|---|
| extProfile | Extension profile. |
| IOException |
|---|
Closes everything that was opened by
generateFeedStart(ExtensionProfile, XmlWriter, Collection.
| w |
|---|
| IOException |
|---|
Generates everything that's in the feed up to and not including the
entries. The idea is to use generateFeedStart(), write the
entries, and then call
generateFeedEnd(com.google.gdata.util.common.xml.XmlWriter)
to avoid having to add entries to a list and keep them in memory.
| extProfile | |
|---|---|
| w | |
| namespaces | Extra namespace declarations |
| IOException |
|---|
Generates XML in the RSS format.
| w | Output writer. |
|---|---|
| extProfile | Extension profile. |
| IOException |
|---|
Locates and returns the most specific Kind.Adaptor feed
subtype for this feed. If none can be found for the current class,
null will be returned.
| Kind.AdaptorException |
|---|
| adaptorClass |
|---|
Returns the collection of Kind.Adaptor instances associated with the
this Adaptable instance.
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.
| returnClass |
|---|
Returns the list of entries in this feed
Returns the current entity tag 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.
The default implementation uses the AbstractExtension.AttributesHandler to handle
parsing the extension.
| p | Extension profile |
|---|---|
| namespace | Extension namespace |
| localName | Tag name, without the namespace prefix |
| attrs | Tag attributes |
| ParseException |
|---|
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 current gd:kind attribute value for this feed. A value of
null indicates the value is unknown.
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 current fields selection for this partial feed. A
value of null indicates the feed is not a partial feed.
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 entity version for this feed.
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. |
Parses XML in the Atom format from a parser-defined content source.
| extProfile | Extension profile. |
|---|---|
| source | XML source. |
| IOException | |
|---|---|
| ParseException |
Parses XML in the Atom format.
| extProfile | Extension profile. |
|---|---|
| input | XML input stream. |
| IOException | |
|---|---|
| ParseException |
Parses XML in the Atom format.
| extProfile | Extension profile. |
|---|---|
| reader | XML Reader. The caller is responsible for ensuring that the character encoding is correct. |
| IOException | |
|---|---|
| ParseException |
This method provides the base implementation of feed reading using either static or dynamic typing. If feedClass is non-null, the method is guaranteed to return an instance of this type, otherwise adaptation will be used to determine the type. The source object may be either an InputStream, Reader, or XmlParser.
| source | |
|---|---|
| feedClass | |
| extProfile |
| IOException | |
|---|---|
| ParseException | |
| ServiceException |
Reads a feed representation from the provided ParseSource.
The return type of the feed will be determined using dynamic adaptation
based upon any Kind category tag found in the input content. If
no kind tag is found a Feed instance will be returned.
| source |
|---|
| IOException | |
|---|---|
| ParseException | |
| ServiceException |
Sets the property that indicates if it is possible to post new entries to the feed.
| v |
|---|
Sets the list to use for storing the entry list
| entryList |
|---|
Sets the current entity tag 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 current gd:kind attribute value for this feed. A value of
null indicates the value is unknown.
| v |
|---|
Sets the current fields selection for this partial feed. A
value of null indicates the feed is not a partial feed.
| fields |
|---|
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 |
|---|
Sets the entity version for this feed. This value will
be used to compute a weak etag for the feed. If null
the last modified date is used to generate the etag.
| v |
|---|
Called to visit all children of this extension point.
| ev | The extension visitor. |
|---|