public class

OtherContent

extends Content
java.lang.Object
   ↳ com.google.gdata.model.Element
     ↳ com.google.gdata.model.atom.Content
       ↳ com.google.gdata.model.atom.OtherContent

Class Overview

Variant of Content for entries containing miscellaneous inlined content types.

Summary

Constants
String KIND The kind name for adaptation.
Fields
public static final ElementKey<String, OtherContent> KEY The key for this element.
[Expand]
Inherited Fields
From class com.google.gdata.model.atom.Content
From class com.google.gdata.model.Element
Public Constructors
OtherContent()
Constructs a new instance using the default key.
OtherContent(Content content)
Constructs a new instance from a more generic Content type.
Protected Constructors
OtherContent(ElementKey<?, ?> key)
Constructs a new instance using the specified element key.
Public Methods
byte[] getBytes()
String getText()
int getType()
Returns this content's type.
XmlBlob getXml()
Element getXmlContent()
Gets the nested xml content of this element.
static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
void setBytes(byte[] v)
Specifies the binary contents.
void setMimeType(ContentType v)
Specifies the MIME type.
void setText(String v)
Specifies the plain-text contents.
void setXml(XmlBlob v)
Specifies the XML contents.
void setXmlContent(Element content)
Sets the nested xml content of this element.
Protected Methods
void validate(ElementMetadata<?, ?> metadata, ValidationContext vc)
Validate the element using the given metadata, and placing any errors into the validation context.
[Expand]
Inherited Methods
From class com.google.gdata.model.atom.Content
From class com.google.gdata.model.Element
From class java.lang.Object
From interface com.google.gdata.data.IContent

Constants

public static final String KIND

The kind name for adaptation.

Constant Value: "other"

Fields

public static final ElementKey<String, OtherContent> KEY

The key for this element.

Public Constructors

public OtherContent ()

Constructs a new instance using the default key.

public OtherContent (Content content)

Constructs a new instance from a more generic Content type.

Parameters
content Generic content

Protected Constructors

protected OtherContent (ElementKey<?, ?> key)

Constructs a new instance using the specified element key.

Parameters
key The element key for this element.

Public Methods

public byte[] getBytes ()

Returns
  • the binary contents

public String getText ()

Returns
  • the plain text contents

public int getType ()

Returns this content's type. The list of valid value is defined in IContent.Type.

Returns
  • the type of this content

public XmlBlob getXml ()

Returns
  • the XML contents

public Element getXmlContent ()

Gets the nested xml content of this element. This will return the first xml element found inside this content.

public static void registerMetadata (MetadataRegistry registry)

Registers the metadata for this element.

Parameters
registry

public void setBytes (byte[] v)

Specifies the binary contents.

Parameters
v

public void setMimeType (ContentType v)

Specifies the MIME type.

Parameters
v

public void setText (String v)

Specifies the plain-text contents.

Parameters
v

public void setXml (XmlBlob v)

Specifies the XML contents.

Parameters
v

public void setXmlContent (Element content)

Sets the nested xml content of this element.

Parameters
content

Protected Methods

protected void validate (ElementMetadata<?, ?> metadata, ValidationContext vc)

Validate the element using the given metadata, and placing any errors into the validation context. The default behavior is to use the metadata validation, subclasses may override this to add their own validation. If the metadata is null (undeclared), no validation will be performed.

Parameters
metadata
vc