com.google.gdata.data.media
Class MediaEntry<E extends BaseEntry<E>>

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.BaseEntry<E>
              extended by com.google.gdata.data.media.MediaEntry<E>
Type Parameters:
E - the entry class for the bound subtype.
All Implemented Interfaces:
Extension, IEntry, Kind.Adaptable, Kind.Adaptor
Direct Known Subclasses:
DocumentListEntry, GoogleBaseMediaEntry, GphotoEntry, VideoEntry

public abstract class MediaEntry<E extends BaseEntry<E>>
extends BaseEntry<E>

The MediaEntry class is an abstract base class for GData services that support media content.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.BaseEntry
BaseEntry.AtomHandler, BaseEntry.EntryState
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
 
Fields inherited from class com.google.gdata.data.BaseEntry
state
 
Fields inherited from class com.google.gdata.data.ExtensionPoint
xmlBlob
 
Fields inherited from class com.google.gdata.data.AbstractExtension
localName, namespace
 
Constructor Summary
protected MediaEntry()
          Constructs a new BaseEntry instance.
protected MediaEntry(BaseEntry<?> sourceEntry)
          Copy constructor that initializes a new BaseEntry instance to have identical contents to another instance, using a shared reference to the same entry state.
 
Method Summary
protected  Content.ChildHandlerInfo getContentHandlerInfo(ExtensionProfile extProfile, org.xml.sax.Attributes attrs)
          Returns information about the content element processing.
 Link getMediaEditLink()
          Retrieves the media resource edit link.
 MediaSource getMediaSource()
           
 void setMediaSource(MediaSource mediaSource)
           
 void setService(Service v)
          Sets the service that this entry is being used with.
 E updateMedia(boolean updateEntry)
          Updates the media content associated with this entry by sending the data contained in the MediaSource of the entry to the associated GData service.
 
Methods inherited from class com.google.gdata.data.BaseEntry
addAdaptor, addHtmlLink, addLink, addLink, delete, generate, generateAtom, generateRss, getAdaptedEntry, getAdaptor, getAdaptors, getAuthors, getCanEdit, getCategories, getContent, getContributors, getEdited, getEditLink, getEtag, getHandler, getHtmlLink, getId, getLink, getLinks, getLinks, getPlainTextContent, getPubControl, getPublished, getRights, getSelf, getSelfLink, getService, getSource, getSummary, getTextContent, getTitle, getUpdated, getVersionId, isDraft, parseAtom, parseAtom, parseAtom, readEntry, readEntry, removeLinks, setCanEdit, setContent, setContent, setDraft, setEdited, setEtag, setId, setPubControl, setPublished, setRights, setSource, setSummary, setTitle, setUpdated, setVersionId, update, visitChildren
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild
 
Methods inherited from class com.google.gdata.data.AbstractExtension
consumeAttributes, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gdata.data.Kind.Adaptor
declareExtensions
 

Constructor Detail

MediaEntry

protected MediaEntry()
Constructs a new BaseEntry instance.


MediaEntry

protected MediaEntry(BaseEntry<?> sourceEntry)
Copy constructor that initializes a new BaseEntry instance to have identical contents to another instance, using a shared reference to the same entry state. Kind.Adaptor subclasses of BaseEntry can use this constructor to create adaptor instances of an entry that share state with the original.

Method Detail

setService

public void setService(Service v)
Description copied from interface: IEntry
Sets the service that this entry is being used with.

Specified by:
setService in interface IEntry
Overrides:
setService in class BaseEntry<E extends BaseEntry<E>>

setMediaSource

public void setMediaSource(MediaSource mediaSource)

getMediaSource

public MediaSource getMediaSource()

getMediaEditLink

public Link getMediaEditLink()
Retrieves the media resource edit link.

Specified by:
getMediaEditLink in interface IEntry
Overrides:
getMediaEditLink in class BaseEntry<E extends BaseEntry<E>>

updateMedia

public E updateMedia(boolean updateEntry)
                                   throws java.io.IOException,
                                          ServiceException
Updates the media content associated with this entry by sending the data contained in the MediaSource of the entry to the associated GData service. Can optionally update the entry content at the same time.

Parameters:
updateEntry - set to {code boolean} true if the current entry content should be updated with the media.
Returns:
the updated entry returned by the Service.
Throws:
ServiceException - If there is no associated GData service or the service is unable to perform the update.
InvalidEntryException - If the entry does not contain MediaContent or there is no MediaSource associated with the content.
java.lang.UnsupportedOperationException - If update is not supported for the target entry.
java.io.IOException - If there is an error communicating with the GData service.

getContentHandlerInfo

protected Content.ChildHandlerInfo getContentHandlerInfo(ExtensionProfile extProfile,
                                                         org.xml.sax.Attributes attrs)
                                                  throws ParseException,
                                                         java.io.IOException
Description copied from class: BaseEntry
Returns information about the content element processing.

Overrides:
getContentHandlerInfo in class BaseEntry<E extends BaseEntry<E>>
Throws:
ParseException
java.io.IOException