public class

YouTubeMediaRating

extends MediaRating
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.media.mediarss.MediaRating
       ↳ com.google.gdata.data.youtube.YouTubeMediaRating

Class Overview

Adds an attribute yt:country to MediaRating.

Summary

Constants
String ALL_COUNTRIES Default value for the tag yt:country.
[Expand]
Inherited Constants
From class com.google.gdata.data.media.mediarss.MediaRating
Fields
private Set<String> countries Unmodifiable set of countries, never null.
private YouTubeMediaRating.CountryState countryState
[Expand]
Inherited Fields
From class com.google.gdata.data.media.mediarss.MediaRating
From class com.google.gdata.data.AbstractExtension
Public Constructors
YouTubeMediaRating()
Public Methods
void clearCountry()
Clears the attribute country of any value.
Set<String> getCountries()
Gets the country set.
static ExtensionDescription getDefaultDescription()
Describes the tag to an ExtensionProfile.
boolean hasCountries()
Checks whether a country set is set.
void setAllCountries()
Explicitely sets the attribute country to all.
void setCountries(Collection<String> countries)
Defines the countries to which the rating applies.
Protected Methods
void consumeAttributes(AttributeHelper attrsHelper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
[Expand]
Inherited Methods
From class com.google.gdata.data.media.mediarss.MediaRating
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String ALL_COUNTRIES

Default value for the tag yt:country.

Constant Value: "all"

Fields

private Set<String> countries

Unmodifiable set of countries, never null.

private YouTubeMediaRating.CountryState countryState

Public Constructors

public YouTubeMediaRating ()

Public Methods

public void clearCountry ()

Clears the attribute country of any value.

public Set<String> getCountries ()

Gets the country set.

Returns
  • country set, which may be empty but not null

public static ExtensionDescription getDefaultDescription ()

Describes the tag to an ExtensionProfile.

public boolean hasCountries ()

Checks whether a country set is set.

Returns
  • true if a country set is set, false if the rating applies to all countries

public void setAllCountries ()

Explicitely sets the attribute country to all.

public void setCountries (Collection<String> countries)

Defines the countries to which the rating applies.

Parameters
countries 2-letter country code set or null to revert to the default value

Protected Methods

protected void consumeAttributes (AttributeHelper attrsHelper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
attrsHelper Attribute helper

protected void putAttributes (AttributeGenerator generator)

Puts attributes into the attribute generator. Called from generate(XmlWriter, ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
generator Attribute generator