org.purl.sword.base
Class Service

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

public class Service
extends XmlElement
implements SwordElementInterface

Represents an Atom Publishing Protocol Service element, with SWORD extensions.

Author:
Neil Taylor

Field Summary
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, localName, prefix
 
Constructor Summary
Service()
          Create a new instance.
Service(ServiceLevel complianceLevel)
          Create a new instance.
Service(ServiceLevel complianceLevel, boolean noOp, boolean verbose)
          Create a new instance with the specified compliance level, noOp and verbose values.
 
Method Summary
 void addWorkspace(Workspace workspace)
          Add a workspace.
 void clearWorkspaces()
          Clear the list of workspaces.
 ServiceLevel getComplianceLevel()
          Get the service compliance level.
 Iterator<Workspace> getWorkspaces()
          Get an Iterator over the workspaces.
 List<Workspace> getWorkspacesList()
          Get a List of workspaces
 boolean isNoOp()
          Get the NoOp value.
 boolean isNoOpSet()
          Determine if the NoOp value has been set.
 boolean isVerbose()
          Get the Verbose setting.
 boolean isVerboseSet()
          Determine if the Verbose value has been set.
 nu.xom.Element marshall()
          Marshall the data in this object to an Element object.
 void setComplianceLevel(ServiceLevel complianceLevel)
          Set the service compliance level.
 void setNoOp(boolean noOp)
          Set the NoOp value.
 void setVerbose(boolean verbose)
          Set the Verbose value.
 void unmarshall(nu.xom.Element service)
          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, toString, wait, wait, wait
 

Constructor Detail

Service

public Service()
Create a new instance.


Service

public Service(ServiceLevel complianceLevel)
Create a new instance.

Parameters:
complianceLevel - The service compliance level.

Service

public Service(ServiceLevel complianceLevel,
               boolean noOp,
               boolean verbose)
Create a new instance with the specified compliance level, noOp and verbose values.

Parameters:
complianceLevel - The service compliance level.
noOp - The noOp.
verbose - The verbose element.
Method Detail

getComplianceLevel

public ServiceLevel getComplianceLevel()
Get the service compliance level.

Returns:
The compliance level.

setComplianceLevel

public void setComplianceLevel(ServiceLevel complianceLevel)
Set the service compliance level.

Parameters:
The - compliance level.

isNoOp

public boolean isNoOp()
Get the NoOp value.

Returns:
The value.

setNoOp

public void setNoOp(boolean noOp)
Set the NoOp value.

Parameters:
noOp - The value.

isNoOpSet

public boolean isNoOpSet()
Determine if the NoOp value has been set. This should be called to check if an item has been programatically set and does not have a default value.

Returns:
True if it has been set programmatically. Otherwise, false.

isVerbose

public boolean isVerbose()
Get the Verbose setting.

Returns:
The value.

setVerbose

public void setVerbose(boolean verbose)
Set the Verbose value.

Parameters:
verbose - The value.

isVerboseSet

public boolean isVerboseSet()
Determine if the Verbose value has been set. This should be called to check if an item has been programatically set and does not have a default value.

Returns:
True if it has been set programmatically. Otherwise, false.

getWorkspaces

public Iterator<Workspace> getWorkspaces()
Get an Iterator over the workspaces.

Returns:
The workspace.

getWorkspacesList

public List<Workspace> getWorkspacesList()
Get a List of workspaces

Returns:
The workspaces in a List

addWorkspace

public void addWorkspace(Workspace workspace)
Add a workspace.

Parameters:
workspace - The workspace.

clearWorkspaces

public void clearWorkspaces()
Clear the list of workspaces.


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 service)
                throws UnmarshallException
Unmarshall the content element into the data in this object.

Specified by:
unmarshall in interface SwordElementInterface
Parameters:
service - 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.