org.purl.sword.atom
Class Author

java.lang.Object
  extended by org.purl.sword.base.XmlElement
      extended by org.purl.sword.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
static String ELEMENT_AUTHOR_NAME
          Deprecated. 
static String ELEMENT_EMAIL
          Deprecated. 
static String ELEMENT_NAME
          Deprecated. 
static String ELEMENT_URI
          Deprecated. 
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, DATE_FORMATS, xmlName
 
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.
Author(String prefix, String localName, String namespaceUri)
           
Author(XmlName name)
           
 
Method Summary
static XmlName elementName()
          Get the XmlName for this class.
 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.
 String toString()
          Return the string.
 void unmarshall(nu.xom.Element author)
          Unmarshall the author details from the specified element.
 SwordValidationInfo unmarshall(nu.xom.Element author, Properties validationProperties)
          Unmarshall the author details from the specified element.
 SwordValidationInfo validate(List<SwordValidationInfo> elements, List<SwordValidationInfo> attributes, Properties validationContext)
           
 SwordValidationInfo validate(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, 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_AUTHOR_NAME

@Deprecated
public static final String ELEMENT_AUTHOR_NAME
Deprecated. 
Label for the 'name' attribute.

See Also:
Constant Field Values

ELEMENT_URI

@Deprecated
public static final String ELEMENT_URI
Deprecated. 
Label for the 'uri' attribute.

See Also:
Constant Field Values

ELEMENT_EMAIL

@Deprecated
public static final String ELEMENT_EMAIL
Deprecated. 
Label for the 'email' attribute.

See Also:
Constant Field Values
Constructor Detail

Author

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


Author

public Author(XmlName name)

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.

Author

public Author(String prefix,
              String localName,
              String namespaceUri)
Parameters:
prefix -
localName -
namespaceUri -
Method Detail

elementName

public static XmlName elementName()
Get the XmlName for this class.

Returns:
The prefix, localname and namespace for this element.

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 SwordValidationInfo unmarshall(nu.xom.Element author,
                                      Properties validationProperties)
                               throws UnmarshallException
Unmarshall the author details from the specified element. The element is a XOM element.

Parameters:
author - The element to unmarshall.
Throws:
UnmarshallException

validate

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

validate

public SwordValidationInfo validate(List<SwordValidationInfo> elements,
                                    List<SwordValidationInfo> attributes,
                                    Properties validationContext)

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 element 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.

toString

public String toString()
Return the string.

Overrides:
toString in class Object
Returns:
String.


Copyright © 2011 DuraSpace. All Rights Reserved.