com.sun.syndication.propono.atom.common
Class Collection

java.lang.Object
  extended by com.sun.syndication.propono.atom.common.Collection
Direct Known Subclasses:
ClientCollection, FileBasedCollection

public class Collection
extends Object

Models an Atom workspace collection.


Constructor Summary
Collection(String title, String titleType, String href)
          Collection MUST have title and href.
 
Method Summary
 boolean accepts(String ct)
          Returns true if contentType is accepted by collection.
 void addCategories(Categories cats)
          Workspace can have multiple Categories objects
static org.jdom.Element collectionToElement(Collection collection)
          Serialize an AtomService.Collection into an XML element
static Collection elementToCollection(org.jdom.Element element)
          Deserialize an Atom service collection XML element into an object
 String getAccept()
          Comma separated list of media-ranges accepted by collection.
 List getCategories()
          Get categories allowed by collection.
 String getHref()
          The URI of the collection
 String getTitle()
          Must have human readable title
 String getTitleType()
          Type of title ("text", "html" or "xhtml")
 void setAccept(String accept)
          Get content-type range accepted by collection.
 void setHref(String href)
          Set URI of collection
 void setTitle(String title)
          Set title of collection.
 void setTitleType(String titleType)
          Type of title ("text", "html" or "xhtml")
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Collection

public Collection(String title,
                  String titleType,
                  String href)
Collection MUST have title and href.

Parameters:
title - Title for collection
titleType - Content type of title (null for plain text)
href - Collection URI.
Method Detail

getAccept

public String getAccept()
Comma separated list of media-ranges accepted by collection.


setAccept

public void setAccept(String accept)
Get content-type range accepted by collection.


getHref

public String getHref()
The URI of the collection


setHref

public void setHref(String href)
Set URI of collection


getTitle

public String getTitle()
Must have human readable title


setTitle

public void setTitle(String title)
Set title of collection.


getTitleType

public String getTitleType()
Type of title ("text", "html" or "xhtml")


setTitleType

public void setTitleType(String titleType)
Type of title ("text", "html" or "xhtml")


addCategories

public void addCategories(Categories cats)
Workspace can have multiple Categories objects


getCategories

public List getCategories()
Get categories allowed by collection.

Returns:
Collection of Categories objects.

accepts

public boolean accepts(String ct)
Returns true if contentType is accepted by collection.


collectionToElement

public static org.jdom.Element collectionToElement(Collection collection)
Serialize an AtomService.Collection into an XML element


elementToCollection

public static Collection elementToCollection(org.jdom.Element element)
Deserialize an Atom service collection XML element into an object