org.purl.sword.atom
Class Entry

java.lang.Object
  extended by org.purl.sword.base.XmlElement
      extended by org.purl.sword.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
static String ELEMENT_CATEGORY
          Deprecated. 
static String ELEMENT_GENERATOR
          Deprecated. 
static String ELEMENT_ID
          Deprecated. 
static String ELEMENT_NAME
          Deprecated. 
static String ELEMENT_PUBLISHED
          Deprecated. 
static String ELEMENT_UPDATED
          Deprecated. 
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, DATE_FORMATS, xmlName
 
Constructor Summary
Entry()
          Create a new instance of the class and initialise it.
Entry(String prefix, String element)
          Create a new instance of the class an initalise it, setting the element namespace and name.
Entry(String prefix, String element, String namespaceUri)
           
Entry(XmlName name)
           
 
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.
static XmlName elementName()
           
 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.
 Generator getGenerator()
          Get the generator for this Entry.
 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()
          Deprecated.  
 Summary getSummary()
          Get the summary.
 Title getTitle()
          Get the title.
 String getUpdated()
          Get the updated date, expressed as a String.
protected  void initialise()
           
protected  boolean isElementChecked(XmlName elementName)
           
 nu.xom.Element marshall()
          Marshal the data stored in this object into Element objects.
protected  void marshallElements(nu.xom.Element entry)
           
 void setContent(Content content)
          Set the content element for this Entry.
 void setGenerator(Generator generator)
          Set the generator 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)
          Deprecated.  
 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)
          Unmarshal the contents of the Entry element into the internal data objects in this object.
 SwordValidationInfo unmarshall(nu.xom.Element entry, Properties validationProperties)
           
 SwordValidationInfo unmarshallWithoutValidate(nu.xom.Element entry, Properties validationProperties)
           
 SwordValidationInfo validate(Properties validationContext)
           
protected  SwordValidationInfo validate(SwordValidationInfo info, Properties validationContext)
           
 
Methods inherited from class org.purl.sword.base.XmlElement
createValidAttributeInfo, getQualifiedName, getQualifiedName, getQualifiedNameWithPrefix, getXmlName, handleIncorrectElement, isInstanceOf, isInstanceOf, processUnexpectedAttributes, processUnexpectedAttributes, unmarshallBoolean, unmarshallInteger, unmarshallString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_NAME

@Deprecated
public static final String ELEMENT_NAME
Deprecated. 
Local name for the element.

See Also:
Constant Field Values

ELEMENT_ID

@Deprecated
public static final String ELEMENT_ID
Deprecated. 
Local name for the atom id element.

See Also:
Constant Field Values

ELEMENT_PUBLISHED

@Deprecated
public static final String ELEMENT_PUBLISHED
Deprecated. 
Local name for the atom published element.

See Also:
Constant Field Values

ELEMENT_UPDATED

@Deprecated
public static final String ELEMENT_UPDATED
Deprecated. 
Local name for the atom updated element.

See Also:
Constant Field Values

ELEMENT_CATEGORY

@Deprecated
public static final String ELEMENT_CATEGORY
Deprecated. 
Local name for the atom category element.

See Also:
Constant Field Values

ELEMENT_GENERATOR

@Deprecated
public static final String ELEMENT_GENERATOR
Deprecated. 
Local name for the atom generator element.

See Also:
Constant Field Values
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'.


Entry

public Entry(String prefix,
             String element)
Create a new instance of the class an initalise it, setting the element namespace and name.

Parameters:
prefix - The namespace prefix of the element
element - The element name

Entry

public Entry(String prefix,
             String element,
             String namespaceUri)
Parameters:
prefix -
element -
namespaceUri -

Entry

public Entry(XmlName name)
Method Detail

elementName

public static XmlName elementName()

isElementChecked

protected boolean isElementChecked(XmlName elementName)

initialise

protected void initialise()

marshall

public nu.xom.Element marshall()
Marshal 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.

marshallElements

protected void marshallElements(nu.xom.Element entry)

unmarshall

public void unmarshall(nu.xom.Element entry)
                throws UnmarshallException
Unmarshal 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.

unmarshallWithoutValidate

public SwordValidationInfo unmarshallWithoutValidate(nu.xom.Element entry,
                                                     Properties validationProperties)
                                              throws UnmarshallException
Throws:
UnmarshallException

unmarshall

public SwordValidationInfo unmarshall(nu.xom.Element entry,
                                      Properties validationProperties)
                               throws UnmarshallException
Throws:
UnmarshallException

validate

public SwordValidationInfo validate(Properties validationContext)
Specified by:
validate in class XmlElement
Returns:

validate

protected SwordValidationInfo validate(SwordValidationInfo info,
                                       Properties validationContext)
Parameters:
info -
validationContext -
Returns:

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 -

getGenerator

public Generator getGenerator()
Get the generator for this Entry.

Returns:
The generator element.

setGenerator

public void setGenerator(Generator generator)
Set the generator for this Entry.

Parameters:
generator -

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)
Set the published date. The date should be in one of the supported formats. This method will not check that the string is in the correct format.

Parameters:
published - The string.

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

@Deprecated
public Source getSource()
Deprecated. 

Get the source for this Entry.

Returns:
The source.

setSource

@Deprecated
public void setSource(Source source)
Deprecated. 

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. See org.purl.sword.XmlElement.stringToDate for the list of supported formats. This particular method will not check if the date is formatted correctly.

Returns:
The date.

setUpdated

public void setUpdated(String updated)
Set the updated date. The date should match one of the supported formats. This method will not check the format of the string.

Parameters:
updated - The string.
See Also:
setPublished


Copyright © 2011 DuraSpace. All Rights Reserved.