org.w3.atom
Class Entry

java.lang.Object
  extended by org.purl.sword.base.XmlElement
      extended by org.w3.atom.Entry
All Implemented Interfaces:
SwordElementInterface
Direct Known Subclasses:
SWORDEntry

public class Entry
extends XmlElement
implements SwordElementInterface

Represents an ATOM entry.

Author:
Neil Taylor

Field Summary
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, localName, prefix
 
Constructor Summary
Entry()
          Create a new instance of the class and initialise it.
 
Method Summary
 void addAuthors(Author author)
          Add an author to the Entry.
 void addCategory(String category)
          Add a category.
 void addContributor(Contributor contributor)
          Add a contributor.
 void addLink(Link link)
          Get the link for this Entry.
 void clearAuthors()
          Clear the list of authors.
 void clearCategories()
          Clear the list of categories.
 void clearContributors()
          Clear the list of contributors.
 void clearLinks()
          Clear the list of links.
 Iterator<Author> getAuthors()
          Get an iterator for the authors in the Entry.
 Iterator<String> getCategories()
          Get an iterator for the categories in this Entry.
 Content getContent()
          Get the content element for this Entry.
 Iterator<Contributor> getContributors()
          Get a list of contributors.
 String getId()
          Get the ID for this Entry.
 Iterator<Link> getLinks()
          Get the list of links for this Entry.
 String getPublished()
          Get the published date, expressed as a String.
 Rights getRights()
          Get the rights for this Entry.
 Source getSource()
          Get the source for this Entry.
 Summary getSummary()
          Get the summary.
 Title getTitle()
          Get the title.
 String getUpdated()
          Get the updated date, expressed as a String.
 nu.xom.Element marshall()
          Mashall the data stored in this object into Element objects.
 void setContent(Content content)
          Set the content element for this Entry.
 void setId(String id)
          Set the ID for this Entry.
 void setPublished(String published)
          Set the published date.
 void setRights(Rights rights)
          Set the rights for this Entry.
 void setSource(Source source)
          Set the source for this entry.
 void setSummary(Summary summary)
          Set the summary.
 void setTitle(Title title)
          Set the title.
 void setUpdated(String updated)
          Set the updated date.
 void unmarshall(nu.xom.Element entry)
          Unmarshall the contents of the Entry element into the internal data objects in this object.
 
Methods inherited from class org.purl.sword.base.XmlElement
dateToString, getQualifiedName, getQualifiedName, isInstanceOf, stringToDate, unmarshallBoolean, unmarshallDate, unmarshallInteger, unmarshallString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Entry

public Entry()
Create a new instance of the class and initialise it. Also, set the prefix to 'atom' and the local name to 'entry'.

Method Detail

marshall

public nu.xom.Element marshall()
Mashall the data stored in this object into Element objects.

Specified by:
marshall in interface SwordElementInterface
Returns:
An element that holds the data associated with this object.

unmarshall

public void unmarshall(nu.xom.Element entry)
                throws UnmarshallException
Unmarshall the contents of the Entry element into the internal data objects in this object.

Specified by:
unmarshall in interface SwordElementInterface
Parameters:
entry - The Entry element to process.
Throws:
UnmarshallException - If the element does not contain an ATOM entry element, or if there is a problem processing the element or any subelements.

getAuthors

public Iterator<Author> getAuthors()
Get an iterator for the authors in the Entry.

Returns:
An iterator.

addAuthors

public void addAuthors(Author author)
Add an author to the Entry.

Parameters:
author - The author to add.

clearAuthors

public void clearAuthors()
Clear the list of authors.


getCategories

public Iterator<String> getCategories()
Get an iterator for the categories in this Entry.

Returns:
An iterator.

addCategory

public void addCategory(String category)
Add a category.

Parameters:
category - the category to add.

clearCategories

public void clearCategories()
Clear the list of categories.


getContent

public Content getContent()
Get the content element for this Entry.

Returns:
The content element.

setContent

public void setContent(Content content)
Set the content element for this Entry.

Parameters:
content -

getContributors

public Iterator<Contributor> getContributors()
Get a list of contributors.

Returns:
An iterator.

addContributor

public void addContributor(Contributor contributor)
Add a contributor.

Parameters:
contributor - The contributor.

clearContributors

public void clearContributors()
Clear the list of contributors.


getId

public String getId()
Get the ID for this Entry.

Returns:
The ID.

setId

public void setId(String id)
Set the ID for this Entry.

Parameters:
id - The ID.

getLinks

public Iterator<Link> getLinks()
Get the list of links for this Entry.

Returns:
An iterator.

addLink

public void addLink(Link link)
Get the link for this Entry.

Parameters:
link - The link.

clearLinks

public void clearLinks()
Clear the list of links.


getPublished

public String getPublished()
Get the published date, expressed as a String.

Returns:
The date.

setPublished

public void setPublished(String published)
                  throws ParseException
Set the published date. Converts the date string into a date. The date should be expressed as a string with the format: 'yyyy-mm-ddThh:mm:ssZ'.

Parameters:
published - The string.
Throws:
ParseException, - if the date does not match format.
ParseException

getRights

public Rights getRights()
Get the rights for this Entry.

Returns:
The rights.

setRights

public void setRights(Rights rights)
Set the rights for this Entry.

Parameters:
rights - The rights.

getSource

public Source getSource()
Get the source for this Entry.

Returns:
The source.

setSource

public void setSource(Source source)
Set the source for this entry.

Parameters:
source - The source.

getSummary

public Summary getSummary()
Get the summary.

Returns:
The summary.

setSummary

public void setSummary(Summary summary)
Set the summary.

Parameters:
summary - The summary.

getTitle

public Title getTitle()
Get the title.

Returns:
The title.

setTitle

public void setTitle(Title title)
Set the title.

Parameters:
title - The title.

getUpdated

public String getUpdated()
Get the updated date, expressed as a String.

Returns:
The date.

setUpdated

public void setUpdated(String updated)
                throws ParseException
Set the updated date. Converts the date string into a date. The date should be expressed as a string with the format: 'yyyy-mm-ddThh:mm:ssZ'.

Parameters:
updated - The string.
Throws:
ParseException, - if the date does not match format.
ParseException


Copyright © 2008 The DSpace Foundation. All Rights Reserved.