public class

Collection

extends ExtensionPoint
implements Reference ICollection
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.introspection.Collection

Class Overview

The Collection class defines the basic Java object model representation and XML parsing/generation support for an APP collection. The implementation is versioned to support the AtomPub draft version 9 introspection format (used for the GData v1 implementation) as well as the final RFC5023 format (used for all other versions). The key difference between the two is that draft used an attribute for the collection title and a comma-delimited list for accepted MIME types, where the final version uses atom:title and repeating app:accept elements.

Summary

Nested Classes
class Collection.Handler XmlParser ElementHandler for app:workspace  
Fields
private List<String> accepts The media types accepted by the collection.
private XmlNamespace atomPubNs
private List<Categories> categoriesList
private Version coreVersion
private String href The href of the collection
private TextConstruct title The title of the collection
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
Collection()
Collection(String href)
Collection(String href, TextConstruct title)
Collection(String href, TextConstruct title, String... accepts)
Public Methods
void addAccept(String accept)
void addCategories(Categories c)
void consumeAttributes(AttributeHelper attrHelper)
Consumes attributes from the attribute helper.
void generate(XmlWriter w, ExtensionProfile extProfile)
Generates XML.
List<String> getAcceptList()
Returns a list of accept values.
static String getAtomEntryAcceptType()
Returns the accept type used in Atom service document to represent the fact that the service accepts Atom entry posting.
List<Categories> getCategoriesList()
XmlParser.ElementHandler getHandler(ExtensionProfile p, String namespace, String localName, Attributes attrs)
The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.
String getHref()
Returns the value of the resource reference.
TextConstruct getTitle()
Returns the title of the collection.
String getType()
The mime type of the collection
void setHref(String href)
Sets the value of the resource reference.
void setTitle(TextConstruct title)
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension
From interface com.google.gdata.data.Reference
From interface com.google.gdata.data.introspection.ICollection

Fields

private List<String> accepts

The media types accepted by the collection. If null, then only Atom entries are supported.

private XmlNamespace atomPubNs

private List<Categories> categoriesList

private Version coreVersion

private String href

The href of the collection

private TextConstruct title

The title of the collection

Public Constructors

public Collection ()

public Collection (String href)

Parameters
href

public Collection (String href, TextConstruct title)

Parameters
href
title

public Collection (String href, TextConstruct title, String... accepts)

Parameters
href
title
accepts

Public Methods

public void addAccept (String accept)

Parameters
accept

public void addCategories (Categories c)

Parameters
c

public void consumeAttributes (AttributeHelper attrHelper)

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
attrHelper Attribute helper

public void generate (XmlWriter w, ExtensionProfile extProfile)

Generates XML.

Parameters
w Output writer
extProfile Extension profile
Throws
IOException

public List<String> getAcceptList ()

Returns a list of accept values.

public static String getAtomEntryAcceptType ()

Returns the accept type used in Atom service document to represent the fact that the service accepts Atom entry posting.

public List<Categories> getCategoriesList ()

public XmlParser.ElementHandler getHandler (ExtensionProfile p, String namespace, String localName, Attributes attrs)

The default implementation uses the AbstractExtension.AttributesHandler to handle parsing the extension.

Parameters
p Extension profile
namespace Extension namespace
localName Tag name, without the namespace prefix
attrs Tag attributes
Returns
  • an element handler

public String getHref ()

Returns the value of the resource reference.

public TextConstruct getTitle ()

Returns the title of the collection.

public String getType ()

The mime type of the collection

public void setHref (String href)

Sets the value of the resource reference.

Parameters
href The resource href.

public void setTitle (TextConstruct title)

Parameters
title