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
          Deprecated. 
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, DATE_FORMATS, xmlName
 
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.
static XmlName elementName()
           
 List<Collection> getCollections()
          Get a list of the collections
 String getTitle()
          Get the content of the Title element.
protected  void initialise()
          Initialise the object, ready for use.
 nu.xom.Element marshall()
          Marshal the data in this element to an Element.
 void setTitle(String title)
          Set the title.
 void unmarshall(nu.xom.Element workspace)
          Unmarshal the workspace element into the data in this object.
 SwordValidationInfo unmarshall(nu.xom.Element workspace, Properties validationProperties)
           
protected  SwordValidationInfo validate(List<SwordValidationInfo> existing, 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, toString, wait, wait, wait
 

Field Detail

ELEMENT_NAME

@Deprecated
public static final String ELEMENT_NAME
Deprecated. 
Local name part of this element.

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

elementName

public static XmlName elementName()

initialise

protected final void initialise()
Initialise the object, ready for use.


setTitle

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

Parameters:
title - The title.

getTitle

public final 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

Returns:
A list.

marshall

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

unmarshall

public SwordValidationInfo unmarshall(nu.xom.Element workspace,
                                      Properties validationProperties)
                               throws UnmarshallException
Parameters:
workspace -
validationProperties -
Returns:
Throws:
UnmarshallException

validate

public SwordValidationInfo validate(Properties validationContext)
Specified by:
validate in class XmlElement
Returns:
A validation object that specifies the status of this object.

validate

protected SwordValidationInfo validate(List<SwordValidationInfo> existing,
                                       Properties validationContext)
Parameters:
existing -
Returns:


Copyright © 2011 DuraSpace. All Rights Reserved.