org.purl.sword.base
Class Collection

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

public class Collection
extends XmlElement
implements SwordElementInterface

A representation of a SWORD Collection. http://www.ukoln.ac.uk/repositories/digirep/index/SWORD_APP_Profile_0.5

Author:
Stuart Lewis, Neil Taylor

Field Summary
static String ELEMENT_NAME
          The element name.
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, localName, prefix
 
Constructor Summary
Collection()
          Create a new instance.
Collection(String location)
          Create a new instance and set the initial location for the collection.
 
Method Summary
 void addAccepts(String accepts)
          Add an accepts entry.
 void clearAccepts()
          Remove all of the accepts associated with this Collection.
 String getAbstract()
          Get the DC Term abstract.
 String[] getAccepts()
          Retrieve an array that holds all of the Accept details.
 List<String> getAcceptsList()
          Retrieve an array that holds all of the Accept details.
 String getCollectionPolicy()
          Get the collection policy.
 String getFormatNamespace()
          Get the format namespace.
 String getLocation()
          Get the location.
 boolean getMediation()
          Get the mediation value.
 String getNamespace()
          Deprecated. Use getFormatNamespace()
 String getTitle()
          Get the title.
 String getTreatment()
          Get the treatment value.
 nu.xom.Element marshall()
          Marshall the data in this object to an Element object.
 void setAbstract(String abstractString)
          Set the abstract.
 void setCollectionPolicy(String collectionPolicy)
          Set the collection policy.
 void setFormatNamespace(String namespace)
          Set the format namespace.
 void setLocation(String location)
          Set the location.
 void setMediation(boolean mediation)
          Set the mediation value.
 void setNamespace(String namespace)
          Deprecated. Use setFormatNamespace
 void setTitle(String title)
          Set the title.
 void setTreatment(String treatment)
          Set the treatment.
 String toString()
          Get a string representation of this object.
 void unmarshall(nu.xom.Element collection)
          Unmarshall the content 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, wait, wait, wait
 

Field Detail

ELEMENT_NAME

public static final String ELEMENT_NAME
The element name.

See Also:
Constant Field Values
Constructor Detail

Collection

public Collection()
Create a new instance.


Collection

public Collection(String location)
Create a new instance and set the initial location for the collection.

Parameters:
location - The initial location, expressed as a URL.
Method Detail

getAccepts

public String[] getAccepts()
Retrieve an array that holds all of the Accept details.

Returns:
An array of strings. Each string represents an individual accept element. The array will have a length of 0 if no accepts elements are stored in this collection.

getAcceptsList

public List<String> getAcceptsList()
Retrieve an array that holds all of the Accept details.

Returns:
An array of strings. Each string represents an individual accept element. The array will have a length of 0 if no accepts elements are stored in this collection.

addAccepts

public void addAccepts(String accepts)
Add an accepts entry.

Parameters:
accepts - The accepts value.

clearAccepts

public void clearAccepts()
Remove all of the accepts associated with this Collection.


getCollectionPolicy

public String getCollectionPolicy()
Get the collection policy.

Returns:
The SWORD collectionPolicy.

setCollectionPolicy

public void setCollectionPolicy(String collectionPolicy)
Set the collection policy.

Parameters:
collectionPolicy - The collection policy.

getLocation

public String getLocation()
Get the location.

Returns:
TShe location

setLocation

public void setLocation(String location)
Set the location.

Parameters:
location - The location.

getMediation

public boolean getMediation()
Get the mediation value.

Returns:
The mediation

setMediation

public void setMediation(boolean mediation)
Set the mediation value.

Parameters:
mediation - The mediation value.

getNamespace

public String getNamespace()
Deprecated. Use getFormatNamespace()

See getFormatNamespace.

Returns:
the namespace

getFormatNamespace

public String getFormatNamespace()
Get the format namespace.

Returns:
The format namespace.

setNamespace

public void setNamespace(String namespace)
Deprecated. Use setFormatNamespace

See setFormatNamespace.

Parameters:
namespace - the namespace to set

setFormatNamespace

public void setFormatNamespace(String namespace)
Set the format namespace.

Parameters:
namespace - The namespace.

getAbstract

public String getAbstract()
Get the DC Term abstract.

Returns:
The abstract.

setAbstract

public void setAbstract(String abstractString)
Set the abstract.

Parameters:
abstractString - The abstract.

setTitle

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

Parameters:
title - The title.

getTitle

public String getTitle()
Get the title.

Returns:
The title, or null if no title has been set.

getTreatment

public String getTreatment()
Get the treatment value.

Returns:
The treatment.

setTreatment

public void setTreatment(String treatment)
Set the treatment.

Parameters:
treatment - The treatment.

toString

public String toString()
Get a string representation of this object. This is equivalent to calling marshall().toString().

Overrides:
toString in class Object

marshall

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

Specified by:
marshall in interface SwordElementInterface
Returns:
A XOM Element that holds the data for this Content element.

unmarshall

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

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


Copyright © 2008 The DSpace Foundation. All Rights Reserved.