org.purl.sword.base
Class Workspace

java.lang.Object
  extended by org.purl.sword.base.XmlElement
      extended by org.purl.sword.base.Workspace
All Implemented Interfaces:
SwordElementInterface

public class Workspace
extends XmlElement
implements SwordElementInterface

Represents an Atom Publishing Protocol Workspace element.

Author:
Neil Taylor

Field Summary
static String ELEMENT_NAME
          The element name that is used in the textual representatin of the XML data.
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, localName, prefix
 
Constructor Summary
Workspace()
          Create a new instance of the workspace, with no title.
Workspace(String title)
          Create a new instance of the workspace with the specified title.
 
Method Summary
 void addCollection(Collection collection)
          Add a collection to the Workspace.
 Iterator<Collection> collectionIterator()
          Get an Iterator over the collections.
 List<Collection> getCollections()
          Get a list of the collections
 String getTitle()
          Get the content of the Title element.
 nu.xom.Element marshall()
          Marshall the data in this element to an Element.
 void setTitle(String title)
          Set the title.
 void unmarshall(nu.xom.Element workspace)
          Unmarshall the workspace element into the data 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
 

Field Detail

ELEMENT_NAME

public static final String ELEMENT_NAME
The element name that is used in the textual representatin of the XML data.

See Also:
Constant Field Values
Constructor Detail

Workspace

public Workspace()
Create a new instance of the workspace, with no title.


Workspace

public Workspace(String title)
Create a new instance of the workspace with the specified title.

Parameters:
title - The title.
Method Detail

setTitle

public void setTitle(String title)
Set the title. The type for the title will be set to ContentType.TEXT

Parameters:
title - The title.

getTitle

public String getTitle()
Get the content of the Title element.

Returns:
The title.

addCollection

public void addCollection(Collection collection)
Add a collection to the Workspace.

Parameters:
collection - The collection.

collectionIterator

public Iterator<Collection> collectionIterator()
Get an Iterator over the collections.

Returns:
An iterator.

getCollections

public List<Collection> getCollections()
Get a list of the collections


marshall

public nu.xom.Element marshall()
Marshall the data in this element to an Element.

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

unmarshall

public void unmarshall(nu.xom.Element workspace)
                throws UnmarshallException
Unmarshall the workspace element into the data in this object.

Specified by:
unmarshall in interface SwordElementInterface
Parameters:
workspace - The data to unmarshall.
Throws:
UnmarshallException - If the element does not contain a workspace element or if there are problems accessing the data.


Copyright © 2008 The DSpace Foundation. All Rights Reserved.