# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.introspection
Class Collection

    java.lang.Object
      com.google.gdata.data.AbstractExtension
          com.google.gdata.data.ExtensionPoint
              com.google.gdata.data.introspection.Collection

All Implemented Interfaces:
  Extension, ICollection, Reference

    public class Collection

extends ExtensionPoint
implements Reference, ICollection

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.

Nested Class Summary
`class` `Collection.Handler` XmlParser ElementHandler for `app:workspace`

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.ExtensionPoint
`xmlBlob`

Fields inherited from class com.google.gdata.data.AbstractExtension
`localName, namespace`

Constructor Summary
`Collection()`
`Collection(java.lang.String href)`
`Collection(java.lang.String href, TextConstruct title)`
`Collection(java.lang.String href, TextConstruct title, java.lang.String... accepts)`

Method Summary
`void` `addAccept(java.lang.String accept)`
`void` `addCategories(Categories c)`
`void` `consumeAttributes(AttributeHelper attrHelper)` Consumes attributes from the attribute helper.
`void` `generate(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)` Generates XML.
`java.util.List<java.lang.String>` `getAcceptList()` Returns a list of accept values.
`static java.lang.String` `getAtomEntryAcceptType()` Returns the accept type used in Atom service document to represent the fact that the service accepts Atom entry posting.
`java.util.List<Categories>` `getCategoriesList()`
`XmlParser.ElementHandler` `getHandler(ExtensionProfile p, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)` The default implementation uses the `AbstractExtension.AttributesHandler` to handle parsing the extension.
`java.lang.String` `getHref()` Returns the value of the resource reference.
`TextConstruct` `getTitle()` Returns the title of the collection.
`java.lang.String` `getType()` The mime type of the collection
`void` `setHref(java.lang.String href)` Sets the value of the resource reference.
`void` `setTitle(TextConstruct title)`

Methods inherited from class com.google.gdata.data.ExtensionPoint

`addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren`

Methods inherited from class com.google.gdata.data.AbstractExtension
`disableStrictValidation, enableStrictValidation, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Collection

    public Collection()

### Collection

    public Collection(java.lang.String href)

### Collection

    public Collection(java.lang.String href,
                      TextConstruct title)

### Collection

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

Method Detail

### getAtomEntryAcceptType

    public static java.lang.String getAtomEntryAcceptType()

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

### getTitle

    public TextConstruct getTitle()

  Description copied from interface: `ICollection`
  Returns the title of the collection.

  Specified by:
    `getTitle` in interface `ICollection`

### setTitle

    public void setTitle(TextConstruct title)

### getHref

    public java.lang.String getHref()

  Description copied from interface: `Reference`
  Returns the value of the resource reference.

  Specified by:
    `getHref` in interface `Reference`

### setHref

    public void setHref(java.lang.String href)

  Description copied from interface: `Reference`
  Sets the value of the resource reference.

  Specified by:
    `setHref` in interface `Reference`
  Parameters:
    `href` - the resource href.

### getType

    public java.lang.String getType()

  The mime type of the collection

### getAcceptList

    public java.util.List<java.lang.String> getAcceptList()

  Description copied from interface: `ICollection`
  Returns a list of accept values.

  Specified by:
    `getAcceptList` in interface `ICollection`

### addAccept

    public void addAccept(java.lang.String accept)

### getCategoriesList

    public java.util.List<Categories> getCategoriesList()

### addCategories

    public void addCategories(Categories c)

### generate

    public void generate(com.google.gdata.util.common.xml.XmlWriter w,
                         ExtensionProfile extProfile)
                  throws java.io.IOException

  Generates XML.

  Specified by:
    `generate` in interface `Extension`
  Overrides:
    `generate` in class `AbstractExtension`
  Parameters:
    `w` - output writer
    `extProfile` - extension profile
  Throws:
    `java.io.IOException`

### consumeAttributes

    public void consumeAttributes(AttributeHelper attrHelper)
                           throws ParseException

  Description copied from class: `AbstractExtension`
  Consumes attributes from the attribute helper. May also use `AttributeHelper.consumeContent(boolean)` to consume the element's text content. Called from `AbstractExtension.getHandler(com.google.gdata.data.ExtensionProfile, java.lang.String, java.lang.String, org.xml.sax.Attributes)`. Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

  Overrides:
    `consumeAttributes` in class `AbstractExtension`
  Parameters:
    `attrHelper` - attribute helper
  Throws:
    `ParseException` - any parsing exception

### getHandler

    public XmlParser.ElementHandler getHandler(ExtensionProfile p,
                                               java.lang.String namespace,
                                               java.lang.String localName,
                                               org.xml.sax.Attributes attrs)

  Description copied from class: `AbstractExtension`
  The default implementation uses the `AbstractExtension.AttributesHandler` to handle parsing the extension.

  Specified by:
    `getHandler` in interface `Extension`
  Overrides:
    `getHandler` in class `ExtensionPoint`
  Parameters:
    `p` - extension profile
    `namespace` - extension namespace
    `localName` - tag name, without the namespace prefix
    `attrs` - tag attributes
  Returns:
    an element handler