org.rometools.propono.atom.common
Class Collection

java.lang.Object
  extended by org.rometools.propono.atom.common.Collection
Direct Known Subclasses:
ClientCollection, FileBasedCollection

public class Collection
extends Object

Models an Atom workspace collection.


Field Summary
static String ENTRY_TYPE
           
 
Constructor Summary
Collection(org.jdom.Element e)
          Load self from XML element
Collection(org.jdom.Element e, String baseURI)
          Load self from XML element and base URI for resolving relative URIs
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 addAccept(String accept)
           
 void addCategories(Categories cats)
          Workspace can have multiple Categories objects
 org.jdom.Element collectionToElement()
          Serialize an AtomService.Collection into an XML element
 Collection elementToCollection(org.jdom.Element element)
          Deserialize an Atom service collection XML element into an object
 List getAccepts()
          List of content-type ranges accepted by collection.
 List getCategories()
          Get categories allowed by collection.
 String getHref()
          The URI of the collection
 String getHrefResolved()
          Get resolved URI of the collection, or null if impossible to determine
 String getHrefResolved(String relativeUri)
          Get resolved URI using collection's baseURI, or null if impossible to determine
 String getTitle()
          Must have human readable title
 String getTitleType()
          Type of title ("text", "html" or "xhtml")
protected  void parseCollectionElement(org.jdom.Element element)
           
 void setAccepts(List accepts)
           
 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
 

Field Detail

ENTRY_TYPE

public static final String ENTRY_TYPE
See Also:
Constant Field Values
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.

Collection

public Collection(org.jdom.Element e)
           throws ProponoException
Load self from XML element

Throws:
ProponoException

Collection

public Collection(org.jdom.Element e,
                  String baseURI)
           throws ProponoException
Load self from XML element and base URI for resolving relative URIs

Throws:
ProponoException
Method Detail

getAccepts

public List getAccepts()
List of content-type ranges accepted by collection.


addAccept

public void addAccept(String accept)

setAccepts

public void setAccepts(List accepts)

getHref

public String getHref()
The URI of the collection


setHref

public void setHref(String href)
Set URI of collection


getHrefResolved

public String getHrefResolved()
Get resolved URI of the collection, or null if impossible to determine


getHrefResolved

public String getHrefResolved(String relativeUri)
Get resolved URI using collection's baseURI, or null if impossible to determine


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 com.sun.syndication.propono.atom.common.Categories objects.

accepts

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


collectionToElement

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


elementToCollection

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

Throws:
ProponoException

parseCollectionElement

protected void parseCollectionElement(org.jdom.Element element)
                               throws ProponoException
Throws:
ProponoException


Copyright © 2007-2013 ROME Project. All Rights Reserved.