public class

MediaDataImpl

extends Object
implements MediaData
java.lang.Object
   ↳ com.google.gdata.data.photos.impl.MediaDataImpl

Class Overview

Implementation of the MediaData interface. This currently only supports mediarss content inside of a media:group element, it doesn't handle inlined media:content or media:thumbnail elements. This class uses a passed in ExtensionPoint to pull extensions from.

Summary

Fields
private ExtensionPoint extPoint
Public Constructors
MediaDataImpl(ExtensionPoint extensionPoint)
Construct a new implementation of MediaData with the given extension point as the backing storage for data.
Public Methods
void addExtension(Extension extension)
Adds an extension object.
void addRepeatingExtension(Extension extension)
Adds a repeating extension object.
void declareExtensions(ExtensionProfile extProfile)
Declares the set of expected Extension types for an Extensible within the target extension profile.
List<MediaCategory> getMediaCategories()
Retrieve the list of media:category elements inside the media:group on this element.
List<MediaContent> getMediaContents()
Retrieve the list of media:content elements inside the media:group on this element.
List<MediaCredit> getMediaCredits()
Retrieve the list of media:credit elements inside the media:group on this element.
MediaGroup getMediaGroup()
Retrieve the media:group element on this element.
MediaKeywords getMediaKeywords()
Retrieve the list of media:keywords elements inside the media:group on this element.
List<MediaThumbnail> getMediaThumbnails()
Retrieve the list of media:thumbnail elements inside the media:group on this element.
void removeExtension(Extension extension)
Removes an extension object.
void removeExtension(Class<? extends Extension> extensionClass)
Removes an extension object based on its class.
void removeRepeatingExtension(Extension extension)
Removes a repeating extension object.
void setExtension(Extension extension)
Sets an extension object.
void setKeywords(MediaKeywords keywords)
Set the media keywords on this element to the given keywords.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.data.photos.Extensible
From interface com.google.gdata.data.photos.MediaData

Fields

private ExtensionPoint extPoint

Public Constructors

public MediaDataImpl (ExtensionPoint extensionPoint)

Construct a new implementation of MediaData with the given extension point as the backing storage for data.

Parameters
extensionPoint

Public Methods

public void addExtension (Extension extension)

Adds an extension object. Forwards to addExtension(Extension).

Parameters
extension

public void addRepeatingExtension (Extension extension)

Adds a repeating extension object. Forwards to addRepeatingExtension(Extension).

Parameters
extension

public void declareExtensions (ExtensionProfile extProfile)

Declares the set of expected Extension types for an Extensible within the target extension profile. Forwards to declareExtensions(ExtensionProfile).

Parameters
extProfile The ExtensionProfile to initialize.

public List<MediaCategory> getMediaCategories ()

Retrieve the list of media:category elements inside the media:group on this element. If either the media:group or media:category elements are missing then an empty list will be returned.

Returns
  • a list of media:category elements found on the element.

public List<MediaContent> getMediaContents ()

Retrieve the list of media:content elements inside the media:group on this element. If either the media:group or media:content elements are missing then an empty list will be returned.

Returns
  • the list of media:content elements on the extension point.

public List<MediaCredit> getMediaCredits ()

Retrieve the list of media:credit elements inside the media:group on this element. If either the media:group or media:credit elements are missing then an empty list will be returned.

Returns
  • a list of media:credit elements found on this element.

public MediaGroup getMediaGroup ()

Retrieve the media:group element on this element. This will return null if there was no media:group element set.

Returns
  • the media:group element on the element.

public MediaKeywords getMediaKeywords ()

Retrieve the list of media:keywords elements inside the media:group on this element. If either the media:group or media:keywords elements are missing then null will be returned.

Returns
  • the media:keywords elements found on the element, or null.

public List<MediaThumbnail> getMediaThumbnails ()

Retrieve the list of media:thumbnail elements inside the media:group on this element. If either the media:group or media:thumbnail elements are missing then an empty list will be returned.

Returns
  • a list of media:thumbnail elements found on the element.

public void removeExtension (Extension extension)

Removes an extension object. Forwards to removeExtension(Extension).

Parameters
extension

public void removeExtension (Class<? extends Extension> extensionClass)

Removes an extension object based on its class. Forwards to removeExtension(Class).

Parameters
extensionClass

public void removeRepeatingExtension (Extension extension)

Removes a repeating extension object. Forwards to removeRepeatingExtension(Extension).

Parameters
extension

public void setExtension (Extension extension)

Sets an extension object. If one exists of this type, it's replaced. Forwards to setExtension(Extension).

Parameters
extension

public void setKeywords (MediaKeywords keywords)

Set the media keywords on this element to the given keywords. Will create the media:group element as needed.

Parameters
keywords