com.google.gdata.model.atom
Class OutOfLineContent

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.atom.Content
          extended by com.google.gdata.model.atom.OutOfLineContent
All Implemented Interfaces:
IContent, IOutOfLineContent, Reference

public class OutOfLineContent
extends Content
implements IOutOfLineContent, Reference

Variant of Content for entries that reference external content.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.gdata.data.IContent
IContent.Type
 
Field Summary
static AttributeKey<java.lang.String> ETAG
          The gd:etag attribute.
static ElementKey<java.lang.String,OutOfLineContent> KEY
          The key for this element.
static java.lang.String KIND
          The kind name for adaptation.
static AttributeKey<java.lang.Long> LENGTH
          Metadata for the length attribute (hidden by default).
 
Fields inherited from class com.google.gdata.model.atom.Content
CONSTRUCT, SRC, TYPE, XML_LANG
 
Constructor Summary
OutOfLineContent()
          Constructs a new instance using the default metadata.
OutOfLineContent(Content content)
          Constructs a new instance from a more generic Content type.
 
Method Summary
 java.lang.String getEtag()
          Returns the HTTP etag for the referenced content or null if unknown.
 java.lang.String getHref()
          Returns the external URI or null if none exists.
 long getLength()
           
 int getType()
          Returns this content's type.
 java.lang.String getUri()
          Deprecated. Use Content.getSrc() instead.
static void registerMetadata(MetadataRegistry registry)
          Registers the metadata for this element.
 void setEtag(java.lang.String etag)
          Sets the HTTP etag for the referenced content.
 void setHref(java.lang.String href)
          Sets the external URI.
 void setLength(long length)
          Specifies the file length (RSS only).
 void setMimeType(ContentType v)
          Specifies the MIME Content type.
 void setSrc(java.net.URI v)
          Specifies the external URI.
 void setUri(java.lang.String v)
          Deprecated. Use setSrc(URI) instead.
 
Methods inherited from class com.google.gdata.model.atom.Content
getLang, getMimeType, getSrc, setLang
 
Methods inherited from class com.google.gdata.model.Element
addElement, addElement, addElement, clear, createElement, createElement, equals, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hashCode, hasTextValue, isLocked, lock, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, toString, visit
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gdata.data.IOutOfLineContent
getMimeType
 
Methods inherited from interface com.google.gdata.data.IContent
getLang
 

Field Detail

KIND

public static final java.lang.String KIND
The kind name for adaptation.

See Also:
Constant Field Values

KEY

public static final ElementKey<java.lang.String,OutOfLineContent> KEY
The key for this element.


LENGTH

public static final AttributeKey<java.lang.Long> LENGTH
Metadata for the length attribute (hidden by default).


ETAG

public static final AttributeKey<java.lang.String> ETAG
The gd:etag attribute. See RFC 2616, Section 3.11.

Constructor Detail

OutOfLineContent

public OutOfLineContent()
Constructs a new instance using the default metadata.


OutOfLineContent

public OutOfLineContent(Content content)
Constructs a new instance from a more generic Content type.

Parameters:
content - generic content
Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


getType

public int getType()
Description copied from class: Content
Returns this content's type. The list of valid value is defined in IContent.Type.

Specified by:
getType in interface IContent
Overrides:
getType in class Content
Returns:
the type of this content
See Also:
IContent.Type

setMimeType

public void setMimeType(ContentType v)
Specifies the MIME Content type.


getUri

@Deprecated
public java.lang.String getUri()
Deprecated. Use Content.getSrc() instead.

Gets the external URI associated with this out-of-line content.

Specified by:
getUri in interface IOutOfLineContent
Returns:
external URI

setUri

@Deprecated
public void setUri(java.lang.String v)
Deprecated. Use setSrc(URI) instead.

Specifies the external URI.

Parameters:
v - external URI

setSrc

public void setSrc(java.net.URI v)
Specifies the external URI.


setLength

public void setLength(long length)
Specifies the file length (RSS only).


getHref

public java.lang.String getHref()
Returns the external URI or null if none exists. This method exists only so that Content implements Reference. Callers should use Content.getSrc() instead whenever possible.

Specified by:
getHref in interface Reference

setHref

public void setHref(java.lang.String href)
Sets the external URI. This method exists only so that Content implements Reference. Callers should use setSrc(URI) instead whenever possible.

Specified by:
setHref in interface Reference
Parameters:
href - external URI or null
Throws:
java.lang.IllegalArgumentException - if href is not a valid URI

getLength

public long getLength()

getEtag

public java.lang.String getEtag()
Returns the HTTP etag for the referenced content or null if unknown.

Specified by:
getEtag in interface IOutOfLineContent

setEtag

public void setEtag(java.lang.String etag)
Sets the HTTP etag for the referenced content. A value of null indicates it is unknown.

Parameters:
etag - HTTP etag value