From db2644adf6f9f5d7b0a813f359d28e4991911af5 Mon Sep 17 00:00:00 2001
From: Patrick Gotthard
- * The following elements are optional and may appear as sub-elements of <channel>,
- * <item>, <media:content> and/or <media:group>.
- *
- *
+ * The following elements are optional and may appear as sub-elements of <channel>, <item>, <media:content> and/or <media:group>.
*
- *
- * When an element appears at a shallow level, such as <channel> or <item>, it means
- * that the element should be applied to every media object within its scope.
+ * When an element appears at a shallow level, such as <channel> or <item>, it means that the element should be applied to every media object within
+ * its scope.
*
- * Duplicated elements appearing at deeper levels of the document tree have higher priority over
- * other levels.
- *
- * For example, <media:content> level elements are favored over <item> level elements.
- * The priority level is listed from strongest to weakest: <media:content>,
- * <media:group>, <item>, <channel>.
+ * Duplicated elements appearing at deeper levels of the document tree have higher priority over other levels.
+ *
+ * For example, <media:content> level elements are favored over <item> level elements. The priority level is listed from strongest to weakest:
+ * <media:content>, <media:group>, <item>, <channel>.
*
- * Allows a taxonomy to be set that gives an indication of the type of media content, and its - * particular contents. It has 2 optional attributes. + * <media:backLinks> *
- * + * + *+ * Allows inclusion of all the URLs pointing to a media object. + *
+ * *- * <media:category scheme="http://search.yahoo.com/mrss/category_ - * schema">music/artist/album/song</media:category> - * - * <media:category scheme="http://dmoz.org" label="Ace Ventura - Pet - * Detective">Arts/Movies/Titles/A/Ace_Ventura_Series/Ace_Ventura_ - * -_Pet_Detective</media:category> - * - * <media:category scheme="urn:flickr:tags">ycantpark - * mobile</media:category> + * <media:backLinks> + * <media:backLink>http://www.backlink1.com</media:backLink> + * <media:backLink>http://www.backlink2.com</media:backLink> + * <media:backLink>http://www.backlink3.com</media:backLink> + * </media:backLinks> *- * - *
- * scheme is the URI that identifies the categorization scheme. It is an optional - * attribute. If this attribute is not included, the default scheme is - * 'http://search.yahoo.com/mrss/category_schema'. - *
- * - *- * label is the human readable label that can be displayed in end user applications. It - * is an optional attribute. - *
- * - * @param categories categories for the item + * + * @return array of backlink urls */ - public void setCategories(final Category[] categories) { - this.categories = categories == null ? new Category[0] : categories; + public URL[] getBackLinks() { + return backLinks; } /** - * <media:category> *- * Allows a taxonomy to be set that gives an indication of the type of media content, and its - * particular contents. It has 2 optional attributes. + * <media:backLinks> *
- * + * + *+ * Allows inclusion of all the URLs pointing to a media object. + *
+ * + *+ * <media:backLinks> + * <media:backLink>http://www.backlink1.com</media:backLink> + * <media:backLink>http://www.backlink2.com</media:backLink> + * <media:backLink>http://www.backlink3.com</media:backLink> + * </media:backLinks> + *+ * + * @param backLinks array of backlink urls + */ + public void setBackLinks(final URL[] backLinks) { + if (backLinks == null) { + this.backLinks = new URL[0]; + } else { + this.backLinks = backLinks; + } + } + + /** + *
+ * <media:category> + *
+ *+ * Allows a taxonomy to be set that gives an indication of the type of media content, and its particular contents. It has 2 optional attributes. + *
+ * ** <media:category scheme="http://search.yahoo.com/mrss/category_ * schema">music/artist/album/song</media:category> @@ -135,18 +163,55 @@ public class Metadata implements Cloneable, Serializable { * <media:category scheme="urn:flickr:tags">ycantpark * mobile</media:category> *- * + * *
- * scheme is the URI that identifies the categorization scheme. It is an optional - * attribute. If this attribute is not included, the default scheme is - * 'http://search.yahoo.com/mrss/category_schema'. + * scheme is the URI that identifies the categorization scheme. It is an optional attribute. If this attribute is not included, the default scheme + * is 'http://search.yahoo.com/mrss/category_schema'. *
- * + * *- * label is the human readable label that can be displayed in end user applications. It - * is an optional attribute. + * label is the human readable label that can be displayed in end user applications. It is an optional attribute. *
- * + * + * @param categories categories for the item + */ + public void setCategories(final Category[] categories) { + if (categories == null) { + this.categories = new Category[0]; + } else { + this.categories = categories; + } + } + + /** + *+ * <media:category> + *
+ *+ * Allows a taxonomy to be set that gives an indication of the type of media content, and its particular contents. It has 2 optional attributes. + *
+ * + *+ * <media:category scheme="http://search.yahoo.com/mrss/category_ + * schema">music/artist/album/song</media:category> + * + * <media:category scheme="http://dmoz.org" label="Ace Ventura - Pet + * Detective">Arts/Movies/Titles/A/Ace_Ventura_Series/Ace_Ventura_ + * -_Pet_Detective</media:category> + * + * <media:category scheme="urn:flickr:tags">ycantpark + * mobile</media:category> + *+ * + *
+ * scheme is the URI that identifies the categorization scheme. It is an optional attribute. If this attribute is not included, the default scheme + * is 'http://search.yahoo.com/mrss/category_schema'. + *
+ * + *+ * label is the human readable label that can be displayed in end user applications. It is an optional attribute. + *
+ * * @return categories for the item. */ public Category[] getCategories() { @@ -154,20 +219,149 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:copyright> + *+ * <media:comments> + *
+ * + *+ * Allows inclusion of all the comments a media object has received. + *
+ * + *+ * <media:comments> + * <media:comment>comment1</media:comment> + * <media:comment>comment2</media:comment> + * <media:comment>comment3</media:comment> + * </media:comments> + *+ * + * @return array of comments + */ + public String[] getComments() { + return comments; + } + + /** + *
+ * <media:comments> + *
+ * + *+ * Allows inclusion of all the comments a media object has received. + *
+ * + *+ * <media:comments> + * <media:comment>comment1</media:comment> + * <media:comment>comment2</media:comment> + * <media:comment>comment3</media:comment> + * </media:comments> + *+ * + * @param comments array of comments + */ + public void setComments(final String[] comments) { + if (comments == null) { + this.comments = new String[0]; + } else { + this.comments = comments; + } + } + + /** + *
+ * <media:community> + *
+ * + *+ * This element stands for the community related content. This allows inclusion of the user perception about a media object in the form of view count, + * ratings and tags. + *
+ * + *+ * <media:community> + * <media:starRating average="3.5" count="20" min="1" max="10" /> + * <media:statistics views="5" favorites="5" /> + * <media:tags>news: 5, abc:3, reuters</media:tags> + * </media:community> + *+ * + *
+ * starRating This element specifies the rating-related information about a media object. Valid attributes are average, count, min and max. + *
+ * + *+ * statistics This element specifies various statistics about a media object like the view count and the favorite count. Valid attributes are views and + * favorites. + *
+ * + *+ * tags This element contains user-generated tags separated by commas in the decreasing order of each tag's weight. Each tag can be assigned an integer + * weight in tag_name:weight format. It's up to the provider to choose the way weight is determined for a tag; for example, number of occurences can be one + * way to decide weight of a particular tag. Default weight is 1. + *
+ * + * @return Community element + */ + public Community getCommunity() { + return community; + } + + /** + *+ * <media:community> + *
+ * + *+ * This element stands for the community related content. This allows inclusion of the user perception about a media object in the form of view count, + * ratings and tags. + *
+ * + *+ * <media:community> + * <media:starRating average="3.5" count="20" min="1" max="10" /> + * <media:statistics views="5" favorites="5" /> + * <media:tags>news: 5, abc:3, reuters</media:tags> + * </media:community> + *+ * + *
+ * starRating This element specifies the rating-related information about a media object. Valid attributes are average, count, min and max. + *
+ * + *+ * statistics This element specifies various statistics about a media object like the view count and the favorite count. Valid attributes are views and + * favorites. + *
+ * + *+ * tags This element contains user-generated tags separated by commas in the decreasing order of each tag's weight. Each tag can be assigned an integer + * weight in tag_name:weight format. It's up to the provider to choose the way weight is determined for a tag; for example, number of occurences can be one + * way to decide weight of a particular tag. Default weight is 1. + *
+ * + * @param community Community element + */ + public void setCommunity(final Community community) { + this.community = community; + } + + /** + *+ * <media:copyright> + *
** Copyright information for media object. It has 1 optional attribute. *
- * + * ** <media:copyright url="http://blah.com/additional-info.html">2005 FooBar Media</media:copyright> **
- * url is the url for a terms of use page or additional copyright information. If the - * media is operating under a Creative Commons license, the Creative Commons module should be - * used instead. It is an optional attribute. + * url is the url for a terms of use page or additional copyright information. If the media is operating under a Creative Commons license, the + * Creative Commons module should be used instead. It is an optional attribute. *
- * + * * @param copyright copyright text */ public void setCopyright(final String copyright) { @@ -175,20 +369,21 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:copyright> + *+ * <media:copyright> + *
** Copyright information for media object. It has 1 optional attribute. *
- * + * ** <media:copyright url="http://blah.com/additional-info.html">2005 FooBar Media</media:copyright> **
- * url is the url for a terms of use page or additional copyright information. If the - * media is operating under a Creative Commons license, the Creative Commons module should be - * used instead. It is an optional attribute. + * url is the url for a terms of use page or additional copyright information. If the media is operating under a Creative Commons license, the + * Creative Commons module should be used instead. It is an optional attribute. *
- * + * * @return Copyright text */ public String getCopyright() { @@ -196,20 +391,21 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:copyright> + *+ * <media:copyright> + *
** Copyright information for media object. It has 1 optional attribute. *
- * + * ** <media:copyright url="http://blah.com/additional-info.html">2005 FooBar Media</media:copyright> **
- * url is the url for a terms of use page or additional copyright information. If the - * media is operating under a Creative Commons license, the Creative Commons module should be - * used instead. It is an optional attribute. + * url is the url for a terms of use page or additional copyright information. If the media is operating under a Creative Commons license, the + * Creative Commons module should be used instead. It is an optional attribute. *
- * + * * @param copyrightUrl link to more copyright information. */ public void setCopyrightUrl(final URI copyrightUrl) { @@ -217,20 +413,21 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:copyright> + *+ * <media:copyright> + *
** Copyright information for media object. It has 1 optional attribute. *
- * + * ** <media:copyright url="http://blah.com/additional-info.html">2005 FooBar Media</media:copyright> **
- * url is the url for a terms of use page or additional copyright information. If the - * media is operating under a Creative Commons license, the Creative Commons module should be - * used instead. It is an optional attribute. + * url is the url for a terms of use page or additional copyright information. If the media is operating under a Creative Commons license, the + * Creative Commons module should be used instead. It is an optional attribute. *
- * + * * @return Link to more copyright information. */ public URI getCopyrightUrl() { @@ -238,33 +435,33 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:credit> - * *- * Notable entity and the contribution to the creation of the media object. Current entities can - * include people, companies, locations, etc. Specific entities can have multiple roles, and - * several entities can have the same role. These should appear as distinct <media:credit> - * elements. It has 2 optional attributes. + * <media:credit> *
- * + * + *+ * Notable entity and the contribution to the creation of the media object. Current entities can include people, companies, locations, etc. Specific + * entities can have multiple roles, and several entities can have the same role. These should appear as distinct <media:credit> elements. It has 2 + * optional attributes. + *
+ * ** <media:credit role="producer" scheme="urn:ebu">entity name</media:credit> **
* role specifies the role the entity played. Must be lowercase. It is an optional attribute. *
- * + * *- * scheme is the URI that identifies the role scheme. It is an optional attribute. If - * this attribute is not included, the default scheme is 'urn:ebu'. See: European Broadcasting - * Union Role Codes. + * scheme is the URI that identifies the role scheme. It is an optional attribute. If this attribute is not included, the default scheme is + * 'urn:ebu'. See: European Broadcasting Union Role Codes. *
- * - * + * + * ** Example roles: *
- * + * ** actor * anchor person @@ -289,44 +486,46 @@ public class Metadata implements Cloneable, Serializable { * vocalist **
- * Additional roles: European - * Broadcasting Union Role Codes - * + * Additional roles: European Broadcasting Union Role Codes + * * @param credits credits for the item. */ public void setCredits(final Credit[] credits) { - this.credits = credits == null ? new Credit[0] : credits; + if (credits == null) { + this.credits = new Credit[0]; + } else { + this.credits = credits; + } } /** - * <media:credit>
- * *- * Notable entity and the contribution to the creation of the media object. Current entities can - * include people, companies, locations, etc. Specific entities can have multiple roles, and - * several entities can have the same role. These should appear as distinct <media:credit> - * elements. It has 2 optional attributes. + * <media:credit> *
- * + * + *+ * Notable entity and the contribution to the creation of the media object. Current entities can include people, companies, locations, etc. Specific + * entities can have multiple roles, and several entities can have the same role. These should appear as distinct <media:credit> elements. It has 2 + * optional attributes. + *
+ * ** <media:credit role="producer" scheme="urn:ebu">entity name</media:credit> **
* role specifies the role the entity played. Must be lowercase. It is an optional attribute. *
- * + * *- * scheme is the URI that identifies the role scheme. It is an optional attribute. If - * this attribute is not included, the default scheme is 'urn:ebu'. See: European Broadcasting - * Union Role Codes. + * scheme is the URI that identifies the role scheme. It is an optional attribute. If this attribute is not included, the default scheme is + * 'urn:ebu'. See: European Broadcasting Union Role Codes. *
- * - * + * + * ** Example roles: *
- * + * ** actor * anchor person @@ -351,10 +550,8 @@ public class Metadata implements Cloneable, Serializable { * vocalist **
- * Additional roles: European - * Broadcasting Union Role Codes - * + * Additional roles: European Broadcasting Union Role Codes + * * @return credits for the time. */ public Credit[] getCredits() { @@ -362,21 +559,21 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:description>
*- * Short description describing the media object typically a sentence in length. It has 1 - * optional attribute. + * <media:description> *
- * + *+ * Short description describing the media object typically a sentence in length. It has 1 optional attribute. + *
+ * ** <media:description type="plain">This was some really bizarre band I listened to as a young lad.</media:description> **
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @param description value of the description */ public void setDescription(final String description) { @@ -384,21 +581,21 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:description> *- * Short description describing the media object typically a sentence in length. It has 1 - * optional attribute. + * <media:description> *
- * + *+ * Short description describing the media object typically a sentence in length. It has 1 optional attribute. + *
+ * ** <media:description type="plain">This was some really bizarre band I listened to as a young lad.</media:description> **
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @return value of the description */ public String getDescription() { @@ -406,21 +603,21 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:description> *- * Short description describing the media object typically a sentence in length. It has 1 - * optional attribute. + * <media:description> *
- * + *+ * Short description describing the media object typically a sentence in length. It has 1 optional attribute. + *
+ * ** <media:description type="plain">This was some really bizarre band I listened to as a young lad.</media:description> **
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @param descriptionType type of the description. */ public void setDescriptionType(final String descriptionType) { @@ -428,21 +625,21 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:description> *- * Short description describing the media object typically a sentence in length. It has 1 - * optional attribute. + * <media:description> *
- * + *+ * Short description describing the media object typically a sentence in length. It has 1 optional attribute. + *
+ * ** <media:description type="plain">This was some really bizarre band I listened to as a young lad.</media:description> **
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @return type of the description */ public String getDescriptionType() { @@ -450,23 +647,69 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:hash> - * + *<media:embed> + * + *
Sometimes player-specific embed code is needed for a player to play any video. <media:embed> allows + * inclusion of such information in the form of key-value pairs.
+ * + *<media:embed url="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" width="512" height="323"> + * <media:param name="type">application/x-shockwave-flash</media:param> + * <media:param name="width">512</media:param> + * <media:param name="height">323</media:param> + * <media:param name="allowFullScreen">true</media:param> + * <media:param name="flashVars"> + * id=7809705&vid=2666306&lang=en-us&intl=us&thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/i/us/sch/cn/video06/2666306_rndf1e4205b_19.jpg + * </media:param> + * </media:embed>+ * + * @return embed information + */ + public Embed getEmbed() { + return embed; + } + + /** + *
<media:embed> + * + *
Sometimes player-specific embed code is needed for a player to play any video. <media:embed> allows + * inclusion of such information in the form of key-value pairs.
+ * + *<media:embed url="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.2" width="512" height="323"> + * <media:param name="type">application/x-shockwave-flash</media:param> + * <media:param name="width">512</media:param> + * <media:param name="height">323</media:param> + * <media:param name="allowFullScreen">true</media:param> + * <media:param name="flashVars"> + * id=7809705&vid=2666306&lang=en-us&intl=us&thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/i/us/sch/cn/video06/2666306_rndf1e4205b_19.jpg + * </media:param> + * </media:embed>+ * + * @param embed embed information + */ + public void setEmbed(final Embed embed) { + this.embed = embed; + } + + /** *
- * This is the hash of the binary media file. It can appear multiple times as long as each - * instance is a different algo. It has 1 optional attribute. + * <media:hash> + *
+ * + *+ * This is the hash of the binary media file. It can appear multiple times as long as each instance is a different algo. It has 1 optional + * attribute. *
**
- * + * ** <media:hash algo="md5">dfdec888b72151965a34b4b59031290a</media:hash> *- * + * *
- * algo indicates the algorithm used to create the hash. Possible values are 'md5' and - * 'sha-1'. Default value is 'md5'. It is an optional attribute. - * + * algo indicates the algorithm used to create the hash. Possible values are 'md5' and 'sha-1'. Default value is 'md5'. It is an optional + * attribute. + * * @param hash sets the hash for the item. */ public void setHash(final Hash hash) { @@ -474,23 +717,25 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:hash>
- * *- * This is the hash of the binary media file. It can appear multiple times as long as each - * instance is a different algo. It has 1 optional attribute. + * <media:hash> + *
+ * + *+ * This is the hash of the binary media file. It can appear multiple times as long as each instance is a different algo. It has 1 optional + * attribute. *
**
- * + * ** <media:hash algo="md5">dfdec888b72151965a34b4b59031290a</media:hash> *- * + * *
- * algo indicates the algorithm used to create the hash. Possible values are 'md5' and - * 'sha-1'. Default value is 'md5'. It is an optional attribute. - * + * algo indicates the algorithm used to create the hash. Possible values are 'md5' and 'sha-1'. Default value is 'md5'. It is an optional + * attribute. + * * @return returns a Hash object for the item. */ public Hash getHash() { @@ -498,33 +743,39 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:keywords>
*- * Highly relevant keywords describing the media object with typically a maximum of ten words. - * The keywords and phrases should be comma delimited. + * <media:keywords> *
- * + *+ * Highly relevant keywords describing the media object with typically a maximum of ten words. The keywords and phrases should be comma delimited. + *
+ * ** <media:keywords>kitty, cat, big dog, yarn, fluffy</media:keywords> *- * + * * @param keywords Array of keywords */ public void setKeywords(final String[] keywords) { - this.keywords = keywords == null ? new String[0] : keywords; + if (keywords == null) { + this.keywords = new String[0]; + } else { + this.keywords = keywords; + } } /** - * <media:keywords> *
- * Highly relevant keywords describing the media object with typically a maximum of ten words. - * The keywords and phrases should be comma delimited. + * <media:keywords> *
- * + *+ * Highly relevant keywords describing the media object with typically a maximum of ten words. The keywords and phrases should be comma delimited. + *
+ * ** <media:keywords>kitty, cat, big dog, yarn, fluffy</media:keywords> *- * + * * @return Array of keywords */ public String[] getKeywords() { @@ -532,45 +783,214 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:rating> - * - * - *
- * This allows the permissible audience to be declared. If this element is not included, it - * assumes that no restrictions are necessary. It has one optional attribute. - *
- * - *- * <media:rating scheme="urn:simple">adult</media:rating> - * <media:rating scheme="urn:icra">r (cz 1 lz 1 nz 1 oz 1 vz 1)</media:rating> - * <media:rating scheme="urn:mpaa">pg</media:rating> + *- * - * - *<media:license>
* - * <media:rating scheme="urn:v-chip">tv-y7-fv</media:rating> - *
- * scheme is the URI that identifies the rating scheme. It is an optional attribute. If - * this attribute is not included, the default scheme is urn:simple (adult | nonadult). - *
- * - *- * - * @param ratings Ratings objects + *
Optional link to specify the machine-readable license associated with the content.
+ * + *<media:license type="text/html" href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons + * Attribution 3.0 United States License</media:license>+ * + * @return the licenses */ - public void setRatings(final Rating[] ratings) { - this.ratings = ratings == null ? new Rating[0] : ratings; + public License[] getLicenses() { + return licenses; + } + + /** + *
<media:license>
+ * + *Optional link to specify the machine-readable license associated with the content.
+ * + *<media:license type="text/html" href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons + * Attribution 3.0 United States License</media:license>+ * + * @param licenses the licenses + */ + public void setLicenses(final License[] licenses) { + if (licenses == null) { + this.licenses = new License[0]; + } else { + this.licenses = licenses; + } + } + + /** + *
<media:location>
+ * + *Optional element to specify geographical information about various locations captured in the content of a media object. + * The format conforms to geoRSS.
+ * + *<media:location description="My house" start="00:01" end="01:00"> + * <georss:where> + * <gml:Point> + * <gml:pos>35.669998 139.770004</gml:pos> + * </gml:Point> + * </georss:where> + * </media:location>+ * + *
description description of the place whose location is being specified.
+ * + *start time at which the reference to a particular location starts in the media object.
+ * + *end time at which the reference to a particular location ends in the media object.
+ * + * @return the locations + */ + public Location[] getLocations() { + return locations; + } + + /** + *<media:location>
+ * + *Optional element to specify geographical information about various locations captured in the content of a media object. + * The format conforms to geoRSS.
+ * + *<media:location description="My house" start="00:01" end="01:00"> + * <georss:where> + * <gml:Point> + * <gml:pos>35.669998 139.770004</gml:pos> + * </gml:Point> + * </georss:where> + * </media:location>+ * + *
description description of the place whose location is being specified.
+ * + *start time at which the reference to a particular location starts in the media object.
+ * + *end time at which the reference to a particular location ends in the media object.
+ * + * @param locations the locations + */ + public void setLocations(final Location[] locations) { + if (locations == null) { + this.locations = new Location[0]; + } else { + this.locations = locations; + } + } + + /** + *<media:peerLink>
+ * + *Optional element for P2P link.
+ * + *<media:peerLink type="application/x-bittorrent" href="http://www.example.org/sampleFile.torrent" />+ * + * @return the peer links + */ + public PeerLink[] getPeerLinks() { + return peerLinks; + } + + /** + *
<media:peerLink>
+ * + *Optional element for P2P link.
+ * + *<media:peerLink type="application/x-bittorrent" href="http://www.example.org/sampleFile.torrent" />+ * + * @param peerLinks the peer links + */ + public void setPeerLinks(final PeerLink[] peerLinks) { + if (peerLinks == null) { + this.peerLinks = new PeerLink[0]; + } else { + this.peerLinks = peerLinks; + } } /** - * <media:rating> - * - * *
- * This allows the permissible audience to be declared. If this element is not included, it - * assumes that no restrictions are necessary. It has one optional attribute. + * <media:price> *
- * + * + *+ * Optional tag to include pricing information about a media object. If this tag is not present, the media object is supposed to be free. One media object + * can have multiple instances of this tag for including different pricing structures. The presence of this tag would mean that media object is not free. + *
+ * + *+ * <media:price type="rent" price="19.99" currency="EUR" /> + * <media:price type="package" info="http://www.dummy.jp/package_info.html" price="19.99" currency="EUR" /> + * <media:price type="subscription" info="http://www.dummy.jp/subscription_info" price="19.99" currency="EUR" /> + *+ * + *
+ * type Valid values are "rent", "purchase", "package" or "subscription". If nothing is specified, then the media is free. + *
+ * + *+ * info if the type is "package" or "subscription", then info is a URL pointing to package or subscription information. This is an optional attribute. + *
+ * + *+ * price is the price of the media object. This is an optional attribute. + *
+ * + *+ * currency -- use ISO 4217 for currency codes. This is an optional attribute. + *
+ * + * @return the prices + */ + public Price[] getPrices() { + return prices; + } + + /** + *+ * <media:price> + *
+ * + *+ * Optional tag to include pricing information about a media object. If this tag is not present, the media object is supposed to be free. One media object + * can have multiple instances of this tag for including different pricing structures. The presence of this tag would mean that media object is not free. + *
+ * + *+ * <media:price type="rent" price="19.99" currency="EUR" /> + * <media:price type="package" info="http://www.dummy.jp/package_info.html" price="19.99" currency="EUR" /> + * <media:price type="subscription" info="http://www.dummy.jp/subscription_info" price="19.99" currency="EUR" /> + *+ * + *
+ * type Valid values are "rent", "purchase", "package" or "subscription". If nothing is specified, then the media is free. + *
+ * + *+ * info if the type is "package" or "subscription", then info is a URL pointing to package or subscription information. This is an optional attribute. + *
+ * + *+ * price is the price of the media object. This is an optional attribute. + *
+ * + *+ * currency -- use ISO 4217 for currency codes. This is an optional attribute. + *
+ * + * @param prices the prices + */ + public void setPrices(final Price[] prices) { + if (prices == null) { + this.prices = new Price[0]; + } else { + this.prices = prices; + } + } + + /** + *+ * <media:rating> + *
+ * + * + *+ * This allows the permissible audience to be declared. If this element is not included, it assumes that no restrictions are necessary. It has one optional + * attribute. + *
+ * ** <media:rating scheme="urn:simple">adult</media:rating> * <media:rating scheme="urn:icra">r (cz 1 lz 1 nz 1 oz 1 vz 1)</media:rating> @@ -578,15 +998,52 @@ public class Metadata implements Cloneable, Serializable { * * <media:rating scheme="urn:v-chip">tv-y7-fv</media:rating> *- * - * + * + * *
- * scheme is the URI that identifies the rating scheme. It is an optional attribute. If - * this attribute is not included, the default scheme is urn:simple (adult | nonadult). + * scheme is the URI that identifies the rating scheme. It is an optional attribute. If this attribute is not included, the default scheme is + * urn:simple (adult | nonadult). *
- * + * *- * + * + * @param ratings Ratings objects + */ + public void setRatings(final Rating[] ratings) { + if (ratings == null) { + this.ratings = new Rating[0]; + } else { + this.ratings = ratings; + } + } + + /** + *
+ * <media:rating> + *
+ * + * + *+ * This allows the permissible audience to be declared. If this element is not included, it assumes that no restrictions are necessary. It has one optional + * attribute. + *
+ * + *+ * <media:rating scheme="urn:simple">adult</media:rating> + * <media:rating scheme="urn:icra">r (cz 1 lz 1 nz 1 oz 1 vz 1)</media:rating> + * <media:rating scheme="urn:mpaa">pg</media:rating> + * + * <media:rating scheme="urn:v-chip">tv-y7-fv</media:rating> + *+ * + * + *
+ * scheme is the URI that identifies the rating scheme. It is an optional attribute. If this attribute is not included, the default scheme is + * urn:simple (adult | nonadult). + *
+ * + *+ * * @return Ratings objects */ public Rating[] getRatings() { @@ -594,59 +1051,109 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:restriction>
- * *- * Allows restrictions to be placed on the aggregator rendering the media in the feed. - * Currently, restrictions are based on distributor (uri) and country codes. This element is - * purely informational and no obligation can be assumed or implied. Only one - * <media:restriction> element of the same type can be applied to a media object - * - all others will be ignored. Entities in this element should be space separated. To - * allow the producer to explicitly declare his/her intentions, two literals are reserved: - * 'all', 'none'. These literals can only be used once. This element has 1 required attribute, - * and 1 optional attribute (with strict requirements for its exclusion). + * <media:responses> *
- * + * + *+ * Allows inclusion of a list of all media responses a media object has received. + *
+ * *- * <media:restriction relationship="allow" type="country">au us</media:restriction> + * <media:responses> + * <media:response>response1</media:response> + * <media:response>response2</media:response> + * <media:response>response3</media:response> + * </media:responses> *- * - *
- * relationship indicates the type of relationship that the restriction represents - * (allow | deny). In the example above, the media object should only be syndicated in Australia - * and the United States. It is a required attribute. - *
- * - * @param restrictions restrictions for the item. + * + * @return array of responses */ - public void setRestrictions(final Restriction[] restrictions) { - this.restrictions = restrictions == null ? new Restriction[0] : restrictions; + public String[] getResponses() { + return responses; } /** - * <media:restriction> - * *- * Allows restrictions to be placed on the aggregator rendering the media in the feed. - * Currently, restrictions are based on distributor (uri) and country codes. This element is - * purely informational and no obligation can be assumed or implied. Only one - * <media:restriction> element of the same type can be applied to a media object - * - all others will be ignored. Entities in this element should be space separated. To - * allow the producer to explicitly declare his/her intentions, two literals are reserved: - * 'all', 'none'. These literals can only be used once. This element has 1 required attribute, - * and 1 optional attribute (with strict requirements for its exclusion). + * <media:responses> *
- * + * + *+ * Allows inclusion of a list of all media responses a media object has received. + *
+ * + *+ * <media:responses> + * <media:response>response1</media:response> + * <media:response>response2</media:response> + * <media:response>response3</media:response> + * </media:responses> + *+ * + * @param responses array of responses + */ + public void setResponses(final String[] responses) { + if (responses == null) { + this.responses = new String[0]; + } else { + this.responses = responses; + } + } + + /** + *
+ * <media:restriction> + *
+ * + *+ * Allows restrictions to be placed on the aggregator rendering the media in the feed. Currently, restrictions are based on distributor (uri) and country + * codes. This element is purely informational and no obligation can be assumed or implied. Only one <media:restriction> element of the same + * type can be applied to a media object - all others will be ignored. Entities in this element should be space separated. To allow the + * producer to explicitly declare his/her intentions, two literals are reserved: 'all', 'none'. These literals can only be used once. This element has 1 + * required attribute, and 1 optional attribute (with strict requirements for its exclusion). + *
+ * ** <media:restriction relationship="allow" type="country">au us</media:restriction> *- * + * *
- * relationship indicates the type of relationship that the restriction represents - * (allow | deny). In the example above, the media object should only be syndicated in Australia - * and the United States. It is a required attribute. + * relationship indicates the type of relationship that the restriction represents (allow | deny). In the example above, the media object should + * only be syndicated in Australia and the United States. It is a required attribute. *
- * + * + * @param restrictions restrictions for the item. + */ + public void setRestrictions(final Restriction[] restrictions) { + if (restrictions == null) { + this.restrictions = new Restriction[0]; + } else { + this.restrictions = restrictions; + } + } + + /** + *+ * <media:restriction> + *
+ * + *+ * Allows restrictions to be placed on the aggregator rendering the media in the feed. Currently, restrictions are based on distributor (uri) and country + * codes. This element is purely informational and no obligation can be assumed or implied. Only one <media:restriction> element of the same + * type can be applied to a media object - all others will be ignored. Entities in this element should be space separated. To allow the + * producer to explicitly declare his/her intentions, two literals are reserved: 'all', 'none'. These literals can only be used once. This element has 1 + * required attribute, and 1 optional attribute (with strict requirements for its exclusion). + *
+ * + *+ * <media:restriction relationship="allow" type="country">au us</media:restriction> + *+ * + *
+ * relationship indicates the type of relationship that the restriction represents (allow | deny). In the example above, the media object should + * only be syndicated in Australia and the United States. It is a required attribute. + *
+ * * @return restrictions for the item. */ public Restriction[] getRestrictions() { @@ -654,67 +1161,193 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:text> - *- * Allows the inclusion of a text transcript, closed captioning, or lyrics of the media content. - * Many of these elements are permitted to provide a time series of text. In such cases, it is - * encouraged, but not required, that the elements be grouped by language and appear in time - * sequence order based on the start time. Elements can have overlapping start - * and end times. It has 4 optional attributes. - *
- * - *- * <media:text type="plain" lang="en" start="00:00:03.000" - * end="00:00:10.000"> Oh, say, can you see</media:text> + *- *<media:rights>
* - * <media:text type="plain" lang="en" start="00:00:10.000" - * end="00:00:17.000">By the dawn's early light</media:text> - *
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. - *
- * - * - * - * - * - * - *- * lang is the primary language encapsulated in the media object. Language codes - * possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute - * detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute. - *
- * - *- * start specifies the start time offset that the text starts being relevant to the - * media object. An example of this would be for closed captioning. It uses the NTP time code - * format (see: the time attribute used in <media:thumbnail>). It is an optional - * attribute. - *
- * - *- * end specifies the end time that the text is relevant. If this attribute is not - * provided, and a start time is used, it is expected that the end time is either the - * end of the clip or the start of the next <media:text> element. - * - * @param text text objects for the item. + *
Optional element to specify the rights information of a media object.
+ * + *<media:rights status="userCreated" /> + * <media:rights status="official" />+ * + * @return the rights */ - public void setText(final Text[] text) { - this.text = text == null ? new Text[0] : text; + public RightsStatus getRights() { + return rights; + } + + /** + *
<media:rights>
+ * + *Optional element to specify the rights information of a media object.
+ * + *<media:rights status="userCreated" /> + * <media:rights status="official" />+ * + * @param rights the rights + */ + public void setRights(final RightsStatus rights) { + this.rights = rights; + } + + /** + *
<media:scene>
+ * + *Optional element to specify various scenes within a media object. It can have multiple child <media:scene> + * elements, where each <media:scene> element contains information about a particular scene. <media:scene> + * has the optional sub-elements <sceneTitle>, <sceneDescription>, <sceneStartTime> and <sceneEndTime>, + * which contains title, description, start and end time of a particular scene in the media, respectively.
+ * + *<media:scenes> + * <media:scene> + * <sceneTitle>sceneTitle1</sceneTitle> + * <sceneDescription>sceneDesc1</sceneDescription> + * <sceneStartTime>00:15</sceneStartTime> + * <sceneEndTime>00:45</sceneEndTime> + * </media:scene> + * <media:scene> + * <sceneTitle>sceneTitle2</sceneTitle> + * <sceneDescription>sceneDesc2</sceneDescription> + * <sceneStartTime>00:57</sceneStartTime> + * <sceneEndTime>01:45</sceneEndTime> + * </media:scene> + * </media:scenes>+ * + * @return the scenes + */ + public Scene[] getScenes() { + return scenes; + } + + /** + *
<media:scene>
+ * + *Optional element to specify various scenes within a media object. It can have multiple child <media:scene> + * elements, where each <media:scene> element contains information about a particular scene. <media:scene> + * has the optional sub-elements <sceneTitle>, <sceneDescription>, <sceneStartTime> and <sceneEndTime>, + * which contains title, description, start and end time of a particular scene in the media, respectively.
+ * + *<media:scenes> + * <media:scene> + * <sceneTitle>sceneTitle1</sceneTitle> + * <sceneDescription>sceneDesc1</sceneDescription> + * <sceneStartTime>00:15</sceneStartTime> + * <sceneEndTime>00:45</sceneEndTime> + * </media:scene> + * <media:scene> + * <sceneTitle>sceneTitle2</sceneTitle> + * <sceneDescription>sceneDesc2</sceneDescription> + * <sceneStartTime>00:57</sceneStartTime> + * <sceneEndTime>01:45</sceneEndTime> + * </media:scene> + * </media:scenes>+ * + * @param scenes the scenes + */ + public void setScenes(final Scene[] scenes) { + if (scenes == null) { + this.scenes = new Scene[0]; + } else { + this.scenes = scenes; + } } /** - * <media:text> *
- * Allows the inclusion of a text transcript, closed captioning, or lyrics of the media content. - * Many of these elements are permitted to provide a time series of text. In such cases, it is - * encouraged, but not required, that the elements be grouped by language and appear in time - * sequence order based on the start time. Elements can have overlapping start - * and end times. It has 4 optional attributes. + * <media:status> *
- * + * + *+ * Optional tag to specify the status of a media object -- whether it's still active or it has been blocked/deleted. + *
+ * + *+ * <media:status state="blocked" reason="http://www.reasonforblocking.com" /> + *+ * + *
+ * state can have values "active", "blocked" or "deleted". "active" means a media object is active in the system, "blocked" means a media object is blocked + * by the publisher, "deleted" means a media object has been deleted by the publisher. + * + *
+ * reason is a reason explaining why a media object has been blocked/deleted. It can be plain text or a URL. + *
+ * + * @return status of media + */ + public Status getStatus() { + return status; + } + + /** + *+ * <media:status> + *
+ * + *+ * Optional tag to specify the status of a media object -- whether it's still active or it has been blocked/deleted. + *
+ * + *+ * <media:status state="blocked" reason="http://www.reasonforblocking.com" /> + *+ * + *
+ * state can have values "active", "blocked" or "deleted". "active" means a media object is active in the system, "blocked" means a media object is blocked + * by the publisher, "deleted" means a media object has been deleted by the publisher. + * + *
+ * reason is a reason explaining why a media object has been blocked/deleted. It can be plain text or a URL. + *
+ * + * @param status status of media + */ + public void setStatus(final Status status) { + this.status = status; + } + + /** + *<media:subTitle>
+ * + *Optional element for subtitle/CC link. It contains type and language attributes. Language is based on RFC 3066. + * There can be more than one such tag per media element, for example one per language. Please refer to + * Timed Text spec - W3C for more information on Timed Text and Real Time Subtitling.
+ * + *<media:subTitle type="application/smil" lang="en-us" href="http://www.example.org/subtitle.smil" />+ * + * @return the subtitles + */ + public SubTitle[] getSubTitles() { + return subTitles; + } + + /** + *
<media:subTitle>
+ * + *Optional element for subtitle/CC link. It contains type and language attributes. Language is based on RFC 3066. + * There can be more than one such tag per media element, for example one per language. Please refer to + * Timed Text spec - W3C for more information on Timed Text and Real Time Subtitling.
+ * + *<media:subTitle type="application/smil" lang="en-us" href="http://www.example.org/subtitle.smil" />+ * + * @param subTitles the subtitles + */ + public void setSubTitles(final SubTitle[] subTitles) { + if (subTitles == null) { + this.subTitles = new SubTitle[0]; + } else { + this.subTitles = subTitles; + } + } + + /** + *
+ * <media:text> + *
+ *+ * Allows the inclusion of a text transcript, closed captioning, or lyrics of the media content. Many of these elements are permitted to provide a time + * series of text. In such cases, it is encouraged, but not required, that the elements be grouped by language and appear in time sequence order based on + * the start time. Elements can have overlapping start and end times. It has 4 optional attributes. + *
+ * ** <media:text type="plain" lang="en" start="00:00:03.000" * end="00:00:10.000"> Oh, say, can you see</media:text> @@ -723,34 +1356,80 @@ public class Metadata implements Cloneable, Serializable { * end="00:00:17.000">By the dawn's early light</media:text> **
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * - * - * - * - * - * + * + * + * + * + * + * *- * lang is the primary language encapsulated in the media object. Language codes - * possible are detailed in RFC 3066. This attribute is used similar to the xml:lang attribute - * detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute. + * lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar + * to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute. *
- * + * *- * start specifies the start time offset that the text starts being relevant to the - * media object. An example of this would be for closed captioning. It uses the NTP time code - * format (see: the time attribute used in <media:thumbnail>). It is an optional - * attribute. + * start specifies the start time offset that the text starts being relevant to the media object. An example of this would be for closed + * captioning. It uses the NTP time code format (see: the time attribute used in <media:thumbnail>). It is an optional attribute. *
- * + * *- * end specifies the end time that the text is relevant. If this attribute is not - * provided, and a start time is used, it is expected that the end time is either the - * end of the clip or the start of the next <media:text> element. - * + * end specifies the end time that the text is relevant. If this attribute is not provided, and a start time is used, it is expected that + * the end time is either the end of the clip or the start of the next <media:text> element. + * + * @param text text objects for the item. + */ + public void setText(final Text[] text) { + if (text == null) { + this.text = new Text[0]; + } else { + this.text = text; + } + } + + /** + *
+ * <media:text> + *
+ *+ * Allows the inclusion of a text transcript, closed captioning, or lyrics of the media content. Many of these elements are permitted to provide a time + * series of text. In such cases, it is encouraged, but not required, that the elements be grouped by language and appear in time sequence order based on + * the start time. Elements can have overlapping start and end times. It has 4 optional attributes. + *
+ * + *+ * <media:text type="plain" lang="en" start="00:00:03.000" + * end="00:00:10.000"> Oh, say, can you see</media:text> + * + * <media:text type="plain" lang="en" start="00:00:10.000" + * end="00:00:17.000">By the dawn's early light</media:text> + *+ *
+ * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. + *
+ * + * + * + * + * + * + *+ * lang is the primary language encapsulated in the media object. Language codes possible are detailed in RFC 3066. This attribute is used similar + * to the xml:lang attribute detailed in the XML 1.0 Specification (Third Edition). It is an optional attribute. + *
+ * + *+ * start specifies the start time offset that the text starts being relevant to the media object. An example of this would be for closed + * captioning. It uses the NTP time code format (see: the time attribute used in <media:thumbnail>). It is an optional attribute. + *
+ * + *+ * end specifies the end time that the text is relevant. If this attribute is not provided, and a start time is used, it is expected that + * the end time is either the end of the clip or the start of the next <media:text> element. + * * @return Text objects for the item. */ public Text[] getText() { @@ -758,19 +1437,20 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:thumbnail>
- * - * *- * Allows particular images to be used as representative images for the media object. If - * multiple thumbnails are included, and time coding is not at play, it is assumed that the - * images are in order of importance. It has 1 required attribute and 3 optional attributes. + * <media:thumbnail> *
- * - * - * - * - * + * + * + *+ * Allows particular images to be used as representative images for the media object. If multiple thumbnails are included, and time coding is not at play, + * it is assumed that the images are in order of importance. It has 1 required attribute and 3 optional attributes. + *
+ * + * + * + * + * ** <media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123" /> *@@ -783,36 +1463,39 @@ public class Metadata implements Cloneable, Serializable { *
* width specifies the width of the thumbnail. It is an optional attribute. *
- * - * + * + * *- * time specifies the time offset in relation to the media object. Typically this is - * used when creating multiple keyframes within a single video. The format for this attribute - * should be in the DSM-CC's Normal Play Time (NTP) as used in RTSP [RFC 2326 3.6 Normal Play Time]. It is an - * optional attribute. + * time specifies the time offset in relation to the media object. Typically this is used when creating multiple keyframes within a single video. + * The format for this attribute should be in the DSM-CC's Normal Play Time (NTP) as used in RTSP [RFC 2326 + * 3.6 Normal Play Time]. It is an optional attribute. *
- * + * * @param thumbnail thumbnails for the image */ public void setThumbnail(final Thumbnail[] thumbnail) { - this.thumbnail = thumbnail == null ? new Thumbnail[0] : thumbnail; + if (thumbnail == null) { + this.thumbnail = new Thumbnail[0]; + } else { + this.thumbnail = thumbnail; + } } /** - * <media:thumbnail> - * - * *- * Allows particular images to be used as representative images for the media object. If - * multiple thumbnails are included, and time coding is not at play, it is assumed that the - * images are in order of importance. It has 1 required attribute and 3 optional attributes. + * <media:thumbnail> *
- * - * - * - * - * + * + * + *+ * Allows particular images to be used as representative images for the media object. If multiple thumbnails are included, and time coding is not at play, + * it is assumed that the images are in order of importance. It has 1 required attribute and 3 optional attributes. + *
+ * + * + * + * + * ** <media:thumbnail url="http://www.foo.com/keyframe.jpg" width="75" height="50" time="12:05:01.123" /> *@@ -825,16 +1508,14 @@ public class Metadata implements Cloneable, Serializable { *
* width specifies the width of the thumbnail. It is an optional attribute. *
- * - * + * + * *- * time specifies the time offset in relation to the media object. Typically this is - * used when creating multiple keyframes within a single video. The format for this attribute - * should be in the DSM-CC's Normal Play Time (NTP) as used in RTSP [RFC 2326 3.6 Normal Play Time]. It is an - * optional attribute. + * time specifies the time offset in relation to the media object. Typically this is used when creating multiple keyframes within a single video. + * The format for this attribute should be in the DSM-CC's Normal Play Time (NTP) as used in RTSP [RFC 2326 + * 3.6 Normal Play Time]. It is an optional attribute. *
- * + * * @return Thumbnails for the image */ public Thumbnail[] getThumbnail() { @@ -842,21 +1523,22 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:title> + *+ * <media:title> + *
** The title of the particular media object. It has 1 optional attribute. *
- * + * ** <media:title type="plain">The Judy's - The Moo Song</media:title> *- * + * *
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @param title Value of the title */ public void setTitle(final String title) { @@ -864,21 +1546,22 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:title> + *+ * <media:title> + *
** The title of the particular media object. It has 1 optional attribute. *
- * + * ** <media:title type="plain">The Judy's - The Moo Song</media:title> *- * + * *
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @return value of the title. */ public String getTitle() { @@ -886,21 +1569,22 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:title> + *+ * <media:title> + *
** The title of the particular media object. It has 1 optional attribute. *
- * + * ** <media:title type="plain">The Judy's - The Moo Song</media:title> *- * + * *
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @param titleType type of the title. */ public void setTitleType(final String titleType) { @@ -908,44 +1592,28 @@ public class Metadata implements Cloneable, Serializable { } /** - * <media:title> + *+ * <media:title> + *
** The title of the particular media object. It has 1 optional attribute. *
- * + * ** <media:title type="plain">The Judy's - The Moo Song</media:title> *- * + * *
- * type specifies the type of text embedded. Possible values are either 'plain' or - * 'html'. Default value is 'plain'. All html must be entity-encoded. It is an optional - * attribute. + * type specifies the type of text embedded. Possible values are either 'plain' or 'html'. Default value is 'plain'. All html must be + * entity-encoded. It is an optional attribute. *
- * + * * @return type of the title */ public String getTitleType() { return titleType; } - /** - * <media:copyright> - *- * Copyright information for media object. It has 1 optional attribute. - *
- * - *- * <media:copyright url="http://blah.com/additional-info.html">2005 FooBar Media</media:copyright> - *- *
- * url is the url for a terms of use page or additional copyright information. If the - * media is operating under a Creative Commons license, the Creative Commons module should be - * used instead. It is an optional attribute. - *
- * - * @return Link to more copyright information. - */ @Override public Object clone() { final Metadata md = new Metadata(); @@ -963,7 +1631,19 @@ public class Metadata implements Cloneable, Serializable { md.setTitle(getTitle()); md.setTitleType(getTitleType()); md.setRestrictions(getRestrictions()); - + md.setBackLinks(getBackLinks()); + md.setCommunity(getCommunity()); + md.setComments(getComments()); + md.setResponses(getResponses()); + md.setStatus(getStatus()); + md.setPrices(getPrices()); + md.setEmbed(getEmbed()); + md.setLicenses(getLicenses()); + md.setSubTitles(getSubTitles()); + md.setPeerLinks(getPeerLinks()); + md.setLocations(getLocations()); + md.setRights(getRights()); + md.setScenes(getScenes()); return md; } diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/PeerLink.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/PeerLink.java new file mode 100644 index 0000000..2f0d321 --- /dev/null +++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/PeerLink.java @@ -0,0 +1,96 @@ +/* + * This code is currently released under the Mozilla Public License. + * http://www.mozilla.org/MPL/ + * + * Alternately you may apply the terms of the Apache Software License + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.rometools.modules.mediarss.types; + +import java.io.Serializable; +import java.net.URL; + +/** + * Optional tag to include peerLink information about a media object. + * + * @since MediaRSS 1.5.0 + */ +public class PeerLink implements Serializable { + + private static final long serialVersionUID = -7117791317811346321L; + private String type; + private URL href; + + public String getType() { + return type; + } + + public void setType(final String type) { + this.type = type; + } + + public URL getHref() { + return href; + } + + public void setHref(final URL href) { + this.href = href; + } + + // CHECKSTYLE:OFF + @Override + public String toString() { + return "PeerLink [type=" + type + ", href=" + href + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (href == null ? 0 : href.hashCode()); + result = prime * result + (type == null ? 0 : type.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PeerLink other = (PeerLink) obj; + if (href == null) { + if (other.href != null) { + return false; + } + } else if (!href.equals(other.href)) { + return false; + } + if (type == null) { + if (other.type != null) { + return false; + } + } else if (!type.equals(other.type)) { + return false; + } + return true; + } + // CHECKSTYLE:ON +} diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Price.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Price.java new file mode 100644 index 0000000..b8e046e --- /dev/null +++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Price.java @@ -0,0 +1,183 @@ +/* + * This code is currently released under the Mozilla Public License. + * http://www.mozilla.org/MPL/ + * + * Alternately you may apply the terms of the Apache Software License + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.rometools.modules.mediarss.types; + +import java.io.Serializable; +import java.net.URL; + +/** + * Optional tag to include pricing information about a media object. + * + * @since MediaRSS 1.5.0 + */ +public class Price implements Serializable { + private static final long serialVersionUID = 446362162632617445L; + + /** + * Valid values are {@code rent}, {@code purchase}, {@code package} or {@code subscription}. + * + * If nothing is specified, then the media is free. + */ + public enum Type { + RENT, PURCHASE, PACKAGE, SUBSCRIPTION; + } + + private Type type; + private Double price; + private String currency; + private URL info; + + /** + * Valid values are "rent", "purchase", "package" or "subscription". If nothing is specified, then the media is free. + * + * @return the type + */ + public Type getType() { + return type; + } + + /** + * Valid values are "rent", "purchase", "package" or "subscription". If nothing is specified, then the media is free. + * + * @param type the type + */ + public void setType(final Type type) { + this.type = type; + } + + /** + * price is the price of the media object. + * + * This is an optional attribute. + * + * @return the price + */ + public Double getPrice() { + return price; + } + + /** + * price is the price of the media object. + * + * This is an optional attribute. + * + * @param price the price + */ + public void setPrice(final Double price) { + this.price = price; + } + + /** + * use ISO 4217 {@link http://en.wikipedia.org/wiki/ISO_4217} for currency codes. This is an optional attribute. + * + * @return ISO 4217 currency code + */ + public String getCurrency() { + return currency; + } + + /** + * use ISO 4217 {@link http://en.wikipedia.org/wiki/ISO_4217} for currency codes. This is an optional attribute. + * + * @param currency ISO 4217 currency code + */ + public void setCurrency(final String currency) { + this.currency = currency; + } + + /** + * if the type is "package" or "subscription", then info is a URL pointing to package or subscription information. + * + * This is an optional attribute. + * + * @return info url + */ + public URL getInfo() { + return info; + } + + /** + * if the type is "package" or "subscription", then info is a URL pointing to package or subscription information. + * + * This is an optional attribute. + * + * @param info url + */ + public void setInfo(final URL info) { + this.info = info; + } + + // CHECKSTYLE:OFF + @Override + public String toString() { + return "Price [type=" + type + ", price=" + price + ", currency=" + currency + ", info=" + info + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (currency == null ? 0 : currency.hashCode()); + result = prime * result + (info == null ? 0 : info.hashCode()); + result = prime * result + (price == null ? 0 : price.hashCode()); + result = prime * result + (type == null ? 0 : type.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Price other = (Price) obj; + if (currency == null) { + if (other.currency != null) { + return false; + } + } else if (!currency.equals(other.currency)) { + return false; + } + if (info == null) { + if (other.info != null) { + return false; + } + } else if (!info.equals(other.info)) { + return false; + } + if (price == null) { + if (other.price != null) { + return false; + } + } else if (!price.equals(other.price)) { + return false; + } + if (type != other.type) { + return false; + } + return true; + } + // CHECKSTYLE:ON +} diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Restriction.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Restriction.java index 1c518e1..a93d253 100644 --- a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Restriction.java +++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Restriction.java @@ -31,14 +31,11 @@ import com.rometools.rome.feed.impl.ToStringBean; * <media:restriction> * *- * Allows restrictions to be placed on the aggregator rendering the media in the feed. Currently, - * restrictions are based on distributor (uri) and country codes. This element is purely - * informational and no obligation can be assumed or implied. Only one <media:restriction> - * element of the same type can be applied to a media object - all others will be - * ignored. Entities in this element should be space separated. To allow the producer to - * explicitly declare his/her intentions, two literals are reserved: 'all', 'none'. These literals - * can only be used once. This element has 1 required attribute, and 1 optional attribute (with - * strict requirements for its exclusion). + * Allows restrictions to be placed on the aggregator rendering the media in the feed. Currently, restrictions are based on distributor (uri) and country codes. + * This element is purely informational and no obligation can be assumed or implied. Only one <media:restriction> element of the same type can be + * applied to a media object - all others will be ignored. Entities in this element should be space separated. To allow the producer to explicitly declare + * his/her intentions, two literals are reserved: 'all', 'none'. These literals can only be used once. This element has 1 required attribute, and 1 optional + * attribute (with strict requirements for its exclusion). *
* *@@ -46,14 +43,13 @@ import com.rometools.rome.feed.impl.ToStringBean; ** *
- * relationship indicates the type of relationship that the restriction represents (allow | - * deny). In the example above, the media object should only be syndicated in Australia and the - * United States. It is a required attribute. + * relationship indicates the type of relationship that the restriction represents (allow | deny). In the example above, the media object should only + * be syndicated in Australia and the United States. It is a required attribute. *
* *- * Note: If the "allow" element is empty and the type is relationship is "allow", - * it is assumed that the empty list means "allow nobody" and the media should not be syndicated. + * Note: If the "allow" element is empty and the type is relationship is "allow", it is assumed that the empty list means "allow nobody" and + * the media should not be syndicated. *
** A more explicit method would be: @@ -64,23 +60,20 @@ import com.rometools.rome.feed.impl.ToStringBean; * * *
- * type specifies the type of restriction (country | uri) that the media can be syndicated. - * It is an optional attribute; however can only be excluded when using one of the literal values - * "all" or "none". + * type specifies the type of restriction (country | uri) that the media can be syndicated. It is an optional attribute; however can only be excluded + * when using one of the literal values "all" or "none". *
* *- * "country" allows restrictions to be placed based on country code. [ISO 3166] + * "country" allows restrictions to be placed based on country code. [ISO 3166] *
*
- * "uri" allows restrictions based on URI. Examples: urn:apple, http://images.google.com, urn:yahoo,
- * etc.
+ * "uri" allows restrictions based on URI. Examples: urn:apple, http://images.google.com, urn:yahoo, etc.
*
* @author cooper
*/
public class Restriction implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 7944281267467298628L;
private final Relationship relationship;
private final String value;
@@ -141,11 +134,11 @@ public class Restriction implements Serializable {
}
/**
- * Indicates the action of the relationship
+ * Indicates the action of the relationship.
*/
- public static class Relationship {
+ public static final class Relationship {
/**
- * An Allow relationship
+ * An Allow relationship.
*/
public static final Relationship ALLOW = new Relationship("allow");
@@ -155,6 +148,9 @@ public class Restriction implements Serializable {
public static final Relationship DENY = new Relationship("deny");
private final String value;
+ /**
+ * @param value realtion name
+ */
private Relationship(final String value) {
this.value = value;
}
@@ -166,20 +162,26 @@ public class Restriction implements Serializable {
}
/**
- * Indicated the type of the relationship
+ * Indicated the type of the relationship.
*/
- public static class Type {
+ public static final class Type {
/**
* Indicates a Country type.
*/
public static final Type COUNTRY = new Type("country");
-
+ /**
+ * Indicates a sharing type.
+ */
+ public static final Type SHARING = new Type("sharing");
/**
* Indicates a URI for a special restriction type.
*/
public static final Type URI = new Type("uri");
private final String value;
+ /**
+ * @param value type name
+ */
private Type(final String value) {
this.value = value;
}
@@ -190,3 +192,4 @@ public class Restriction implements Serializable {
}
}
}
+
diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Scene.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Scene.java
new file mode 100644
index 0000000..3e56e11
--- /dev/null
+++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Scene.java
@@ -0,0 +1,130 @@
+/*
+ * This code is currently released under the Mozilla Public License.
+ * http://www.mozilla.org/MPL/
+ *
+ * Alternately you may apply the terms of the Apache Software License
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.rometools.modules.mediarss.types;
+
+import java.io.Serializable;
+
+/**
+ * Optional tag to include scene information about a media object.
+ *
+ * @since MediaRSS 1.5.0
+ */
+public class Scene implements Serializable {
+
+ private static final long serialVersionUID = 7901019257277734134L;
+
+ private String title;
+ private String description;
+ private Time startTime;
+ private Time endTime;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(final String description) {
+ this.description = description;
+ }
+
+ public Time getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(final Time startTime) {
+ this.startTime = startTime;
+ }
+
+ public Time getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(final Time endTime) {
+ this.endTime = endTime;
+ }
+
+ // CHECKSTYLE:OFF
+ @Override
+ public String toString() {
+ return "Scene [title=" + title + ", description=" + description + ", startTime=" + startTime + ", endTime=" + endTime + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (description == null ? 0 : description.hashCode());
+ result = prime * result + (endTime == null ? 0 : endTime.hashCode());
+ result = prime * result + (startTime == null ? 0 : startTime.hashCode());
+ result = prime * result + (title == null ? 0 : title.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Scene other = (Scene) obj;
+ if (description == null) {
+ if (other.description != null) {
+ return false;
+ }
+ } else if (!description.equals(other.description)) {
+ return false;
+ }
+ if (endTime == null) {
+ if (other.endTime != null) {
+ return false;
+ }
+ } else if (!endTime.equals(other.endTime)) {
+ return false;
+ }
+ if (startTime == null) {
+ if (other.startTime != null) {
+ return false;
+ }
+ } else if (!startTime.equals(other.startTime)) {
+ return false;
+ }
+ if (title == null) {
+ if (other.title != null) {
+ return false;
+ }
+ } else if (!title.equals(other.title)) {
+ return false;
+ }
+ return true;
+ }
+ // CHECKSTYLE:ON
+}
diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/StarRating.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/StarRating.java
new file mode 100644
index 0000000..4572453
--- /dev/null
+++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/StarRating.java
@@ -0,0 +1,128 @@
+/*
+ * This code is currently released under the Mozilla Public License.
+ * http://www.mozilla.org/MPL/
+ *
+ * Alternately you may apply the terms of the Apache Software License
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.rometools.modules.mediarss.types;
+
+import java.io.Serializable;
+
+/**
+ * This element specifies the rating-related information about a media object.
+ *
+ * @since MediaRSS 1.5.0
+ */
+public class StarRating implements Serializable {
+ private static final long serialVersionUID = -6807718323210492980L;
+ private Double average;
+ private Integer count;
+ private Integer min;
+ private Integer max;
+
+ public Double getAverage() {
+ return average;
+ }
+
+ public void setAverage(final Double average) {
+ this.average = average;
+ }
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(final Integer count) {
+ this.count = count;
+ }
+
+ public Integer getMin() {
+ return min;
+ }
+
+ public void setMin(final Integer min) {
+ this.min = min;
+ }
+
+ public Integer getMax() {
+ return max;
+ }
+
+ public void setMax(final Integer max) {
+ this.max = max;
+ }
+
+ //CHECKSTYLE:OFF
+ @Override
+ public String toString() {
+ return "StarRating [average=" + average + ", count=" + count + ", min=" + min + ", max=" + max + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (average == null ? 0 : average.hashCode());
+ result = prime * result + (count == null ? 0 : count.hashCode());
+ result = prime * result + (max == null ? 0 : max.hashCode());
+ result = prime * result + (min == null ? 0 : min.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final StarRating other = (StarRating) obj;
+ if (average == null) {
+ if (other.average != null) {
+ return false;
+ }
+ } else if (!average.equals(other.average)) {
+ return false;
+ }
+ if (count == null) {
+ if (other.count != null) {
+ return false;
+ }
+ } else if (!count.equals(other.count)) {
+ return false;
+ }
+ if (max == null) {
+ if (other.max != null) {
+ return false;
+ }
+ } else if (!max.equals(other.max)) {
+ return false;
+ }
+ if (min == null) {
+ if (other.min != null) {
+ return false;
+ }
+ } else if (!min.equals(other.min)) {
+ return false;
+ }
+ return true;
+ }
+ //CHECKSTYLE:ON
+}
\ No newline at end of file
diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Statistics.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Statistics.java
new file mode 100644
index 0000000..f7fb96d
--- /dev/null
+++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Statistics.java
@@ -0,0 +1,95 @@
+/*
+ * This code is currently released under the Mozilla Public License.
+ * http://www.mozilla.org/MPL/
+ *
+ * Alternately you may apply the terms of the Apache Software License
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.rometools.modules.mediarss.types;
+
+import java.io.Serializable;
+
+/**
+ *
+ * media:statistics element.
+ *
+ * @since MediaRSS 1.5.0
+ */
+public class Statistics implements Serializable {
+ private static final long serialVersionUID = -2184017520632902691L;
+ private Integer views;
+ private Integer favorites;
+
+ public Integer getViews() {
+ return views;
+ }
+
+ public void setViews(final Integer views) {
+ this.views = views;
+ }
+
+ public Integer getFavorites() {
+ return favorites;
+ }
+
+ public void setFavorites(final Integer favorites) {
+ this.favorites = favorites;
+ }
+
+ // CHECKSTYLE:OFF
+ @Override
+ public String toString() {
+ return "Statistics [views=" + views + ", favorites=" + favorites + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (favorites == null ? 0 : favorites.hashCode());
+ result = prime * result + (views == null ? 0 : views.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Statistics other = (Statistics) obj;
+ if (favorites == null) {
+ if (other.favorites != null) {
+ return false;
+ }
+ } else if (!favorites.equals(other.favorites)) {
+ return false;
+ }
+ if (views == null) {
+ if (other.views != null) {
+ return false;
+ }
+ } else if (!views.equals(other.views)) {
+ return false;
+ }
+ return true;
+ }
+ // CHECKSTYLE:ON
+}
diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Status.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Status.java
new file mode 100644
index 0000000..12a269d
--- /dev/null
+++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Status.java
@@ -0,0 +1,127 @@
+/*
+ * This code is currently released under the Mozilla Public License.
+ * http://www.mozilla.org/MPL/
+ *
+ * Alternately you may apply the terms of the Apache Software License
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.rometools.modules.mediarss.types;
+
+import java.io.Serializable;
+
+/**
+ * Optional tag to specify the status of a media object -- whether it's still active or it has been blocked/deleted.
+ *
+ * @since MediaRSS 1.5.0
+ */
+public class Status implements Serializable {
+ private static final long serialVersionUID = 7136177408594285103L;
+
+ /**
+ * state can have values {@code active}, {@code blocked} or {@code deleted}.
+ *
+ * {@code active} means a media object is active in the system, {@code blocked} means a media object is blocked by
+ * the publisher, {@code deleted} means a media object has been deleted by the publisher.
+ */
+ public enum State {
+ active, blocked, deleted;
+ }
+
+ private State state;
+ private String reason;
+
+ /**
+ * state can have values {@code active}, {@code blocked} or {@code deleted}.
+ *
+ * {@code active} means a media object is active in the system, {@code blocked} means a media object is blocked by
+ * the publisher, {@code deleted} means a media object has been deleted by the publisher.
+ *
+ * @return the state
+ */
+ public State getState() {
+ return state;
+ }
+
+ /**
+ * state can have values {@code active}, {@code blocked} or {@code deleted}.
+ *
+ * {@code active} means a media object is active in the system, {@code blocked} means a media object is blocked by
+ * the publisher, {@code deleted} means a media object has been deleted by the publisher.
+ *
+ * @param state the state
+ */
+ public void setState(final State state) {
+ this.state = state;
+ }
+
+ /**
+ * reason is a reason explaining why a media object has been blocked/deleted. It can be plain text or a URL.
+ *
+ * @return plain text or URL
+ */
+ public String getReason() {
+ return reason;
+ }
+
+ /**
+ * reason is a reason explaining why a media object has been blocked/deleted. It can be plain text or a URL.
+ *
+ * @param reason plain text or URL
+ */
+ public void setReason(final String reason) {
+ this.reason = reason;
+ }
+
+ // CHECKSTYLE:OFF
+ @Override
+ public String toString() {
+ return "Status [state=" + state + ", reason=" + reason + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (reason == null ? 0 : reason.hashCode());
+ result = prime * result + (state == null ? 0 : state.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Status other = (Status) obj;
+ if (reason == null) {
+ if (other.reason != null) {
+ return false;
+ }
+ } else if (!reason.equals(other.reason)) {
+ return false;
+ }
+ if (state != other.state) {
+ return false;
+ }
+ return true;
+ }
+ // CHECKSTYLE:ON
+}
diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/SubTitle.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/SubTitle.java
new file mode 100644
index 0000000..56bb50e
--- /dev/null
+++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/SubTitle.java
@@ -0,0 +1,113 @@
+/*
+ * This code is currently released under the Mozilla Public License.
+ * http://www.mozilla.org/MPL/
+ *
+ * Alternately you may apply the terms of the Apache Software License
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.rometools.modules.mediarss.types;
+
+import java.io.Serializable;
+import java.net.URL;
+
+/**
+ * Optional tag to include subTitle information about a media object.
+ *
+ * @since MediaRSS 1.5.0
+ */
+public class SubTitle implements Serializable {
+
+ private static final long serialVersionUID = -4453481267661711890L;
+ private String type;
+ private String lang;
+ private URL href;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public String getLang() {
+ return lang;
+ }
+
+ public void setLang(final String lang) {
+ this.lang = lang;
+ }
+
+ public URL getHref() {
+ return href;
+ }
+
+ public void setHref(final URL href) {
+ this.href = href;
+ }
+
+ // CHECKSTYLE:OFF
+ @Override
+ public String toString() {
+ return "SubTitle [type=" + type + ", lang=" + lang + ", href=" + href + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (href == null ? 0 : href.hashCode());
+ result = prime * result + (lang == null ? 0 : lang.hashCode());
+ result = prime * result + (type == null ? 0 : type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final SubTitle other = (SubTitle) obj;
+ if (href == null) {
+ if (other.href != null) {
+ return false;
+ }
+ } else if (!href.equals(other.href)) {
+ return false;
+ }
+ if (lang == null) {
+ if (other.lang != null) {
+ return false;
+ }
+ } else if (!lang.equals(other.lang)) {
+ return false;
+ }
+ if (type == null) {
+ if (other.type != null) {
+ return false;
+ }
+ } else if (!type.equals(other.type)) {
+ return false;
+ }
+ return true;
+ }
+ // CHECKSTYLE:ON
+}
diff --git a/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Tag.java b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Tag.java
new file mode 100644
index 0000000..2f4fdf2
--- /dev/null
+++ b/rome-modules/src/main/java/com/rometools/modules/mediarss/types/Tag.java
@@ -0,0 +1,122 @@
+/*
+ * This code is currently released under the Mozilla Public License.
+ * http://www.mozilla.org/MPL/
+ *
+ * Alternately you may apply the terms of the Apache Software License
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package com.rometools.modules.mediarss.types;
+
+import java.io.Serializable;
+
+/**
+ * optionally weighted tag in media:tags.
+ *
+ * @since MediaRSS 1.5.0
+ */
+public class Tag implements Serializable, Comparable