package com.adobe.xml.syndication.generic
{
import com.adobe.xml.syndication.atom.Author;
import com.adobe.xml.syndication.atom.FeedData10;
/**
* Class that abstracts out the specific characteristics of an Atom feed
* into generic metadata. In this case, metadata refers to any data not
* contained in an entry (in other words, data about the feed itself).
* You create an instance using a FeedData object, then you can access it
* in a generic way.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public class Atom10Metadata
implements IMetadata
{
private var feedData:FeedData10;
/**
* Create a new Atom10Item instance.
*
* @param feedData An Atom FeedData object.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function Atom10Metadata(feedData:FeedData10)
{
this.feedData = feedData;
}
/**
* This feed's title.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get title():String
{
return this.feedData.title.value;
}
/**
* An array of authors.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get authors():Array
{
if (this.feedData.authors == null || this.feedData.authors.length == 0)
{
return null;
}
var authors:Array = new Array();
var author:com.adobe.xml.syndication.atom.Author;
for each (author in this.feedData.authors)
{
var newAuthor:com.adobe.xml.syndication.generic.Author = new com.adobe.xml.syndication.generic.Author();
newAuthor.name = author.name;
newAuthor.url = author.uri;
newAuthor.email = author.email;
authors.push(newAuthor);
}
return authors;
}
/**
* This feed's link.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get link():String
{
return this.feedData.link.href;
}
/**
* Who ownes the rights to this feed.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get rights():String
{
return this.feedData.rights.value;
}
/**
* An image associated with this feed.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get image():Image
{
var image:Image = new Image;
image.url = this.feedData.logo;
return image;
}
/**
* The date this feed was last published.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get date():Date
{
return this.feedData.updated;
}
/**
* A description of this feed.
*
* @langversion ActionScript 3.0
* @playerversion Flash 8.5
* @tiptext
*/
public function get description():String
{
return this.feedData.subtitle.value;
}
}
}