org.w3.atom
Class Author

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

public class Author
extends XmlElement
implements SwordElementInterface

Represents an Author type, as used in ATOM. This class is used as the base class for the different areas of ATOM that represent information about people. This includes the atom:author and atom:contributor elements.

Author:
Neil Taylor

Field Summary
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, localName, prefix
 
Constructor Summary
Author()
          Create a new instance and set the prefix to 'atom' and the local name to 'author'.
Author(String prefix, String localName)
          Create a new instance and set the element name.
 
Method Summary
 String getEmail()
          Get the author email.
 String getName()
          Retrieve the author name.
 String getUri()
          Get the author URI.
 nu.xom.Element marshall()
          Marshall the data in this object to a XOM Element.
 void setEmail(String email)
          Set the author email.
 void setName(String name)
          Set the author name.
 void setUri(String uri)
          Set the author URI.
 void unmarshall(nu.xom.Element author)
          Unmarshall the author details from the specified element.
 
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

Author

public Author()
Create a new instance and set the prefix to 'atom' and the local name to 'author'.


Author

public Author(String prefix,
              String localName)
Create a new instance and set the element name.

Parameters:
prefix - The prefix to use when marshalling the data.
localName - The localName to use when marshalling the data.
Method Detail

marshall

public nu.xom.Element marshall()
Marshall the data in this object to a XOM Element. The element will have the full name that is specified in the constructor.

Specified by:
marshall in interface SwordElementInterface
Returns:
A XOM Element.

unmarshall

public void unmarshall(nu.xom.Element author)
                throws UnmarshallException
Unmarshall the author details from the specified element. The element is a XOM element.

Specified by:
unmarshall in interface SwordElementInterface
Parameters:
author - The data to unmarshall.
Throws:
UnmarshallException - If the element is not of the correct type, or if there is an error unmarshalling the data.

getName

public String getName()
Retrieve the author name.

Returns:
The name.

setName

public void setName(String name)
Set the author name.

Parameters:
name - The name.

getUri

public String getUri()
Get the author URI.

Returns:
The URI.

setUri

public void setUri(String uri)
Set the author URI.

Parameters:
uri - the URI.

getEmail

public String getEmail()
Get the author email.

Returns:
The email.

setEmail

public void setEmail(String email)
Set the author email.

Parameters:
email - The email.


Copyright © 2008 The DSpace Foundation. All Rights Reserved.