org.purl.sword.base
Class SWORDEntry

java.lang.Object
  extended by org.purl.sword.base.XmlElement
      extended by org.purl.sword.atom.Entry
          extended by org.purl.sword.base.SWORDEntry
All Implemented Interfaces:
SwordElementInterface
Direct Known Subclasses:
SWORDErrorDocument

public class SWORDEntry
extends Entry

Extension of the ATOM Entry class. This adds support for the additional SWORD elements. These elements reside inside the ATOM Entry object, created in org.w3.atom.Entry class.

Author:
Neil Taylor

Field Summary
protected  SwordNoOp swordNoOp
          Specifies whether the document was run in noOp mode, i.e.
protected  SwordTreatment swordTreatment
          Used for a human readable statement about what treatment the deposited resource has received.
protected  SwordUserAgent swordUserAgent
          The user agent
protected  SwordVerboseDescription swordVerboseDescription
          Use to supply a verbose description.
 
Fields inherited from class org.purl.sword.atom.Entry
ELEMENT_CATEGORY, ELEMENT_GENERATOR, ELEMENT_ID, ELEMENT_NAME, ELEMENT_PUBLISHED, ELEMENT_UPDATED
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, DATE_FORMATS, xmlName
 
Constructor Summary
SWORDEntry()
          A default constructor.
SWORDEntry(String namespace, String element, String namespaceUri)
          Create a new SWORDEntry with the given namespace and element.
SWORDEntry(XmlName name)
           
 
Method Summary
 String getPackaging()
          Get the packaging format
 String getTreatment()
          Get the treatment value.
 String getUserAgent()
          Get the user agent
 String getVerboseDescription()
          Get the Verbose Description for this entry.
protected  void initialise()
           
protected  boolean isElementChecked(XmlName elementName)
           
 boolean isNoOp()
          Get the current value of NoOp.
 boolean isNoOpSet()
          Determine if the noOp value has been set.
protected  void marshallElements(nu.xom.Element entry)
           
 void setNoOp(boolean noOp)
          Call this method to set noOp.
 void setPackaging(String packaging)
          Set the packaging format
 void setTreatment(String treatment)
          Set the treatment value.
 void setUserAgent(String userAgent)
          Set the user agent
 void setVerboseDescription(String verboseDescription)
          Set the verbose description.
 void unmarshall(nu.xom.Element entry)
          Overrides the unmarshall method in the parent Entry.
 SwordValidationInfo unmarshall(nu.xom.Element entry, Properties validationProperties)
           
 SwordValidationInfo unmarshallWithValidation(nu.xom.Element entry, Properties validationProperties)
          Overrides the unmarshall method in the parent Entry.
 SwordValidationInfo validate(Properties validationContext)
           
protected  SwordValidationInfo validate(SwordValidationInfo info, Properties validationContext)
           
 
Methods inherited from class org.purl.sword.atom.Entry
addAuthors, addCategory, addContributor, addLink, clearAuthors, clearCategories, clearContributors, clearLinks, elementName, getAuthors, getCategories, getContent, getContributors, getGenerator, getId, getLinks, getPublished, getRights, getSource, getSummary, getTitle, getUpdated, marshall, setContent, setGenerator, setId, setPublished, setRights, setSource, setSummary, setTitle, setUpdated, unmarshallWithoutValidate
 
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

swordNoOp

protected SwordNoOp swordNoOp
Specifies whether the document was run in noOp mode, i.e. if the document records that no operation was taken for the deposit other than to generate a response.


swordVerboseDescription

protected SwordVerboseDescription swordVerboseDescription
Use to supply a verbose description.


swordTreatment

protected SwordTreatment swordTreatment
Used for a human readable statement about what treatment the deposited resource has received. Include either a text description or a URI.


swordUserAgent

protected SwordUserAgent swordUserAgent
The user agent

Constructor Detail

SWORDEntry

public SWORDEntry(String namespace,
                  String element,
                  String namespaceUri)
Create a new SWORDEntry with the given namespace and element. This method is not normally used, instead the default constructor should be used as this will set the namespace and element correctly.

Parameters:
namespace - The namespace of the element
element - The element name

SWORDEntry

public SWORDEntry()
A default constructor.


SWORDEntry

public SWORDEntry(XmlName name)
Method Detail

initialise

protected void initialise()
Overrides:
initialise in class Entry

isNoOp

public boolean isNoOp()
Get the current value of NoOp.

Returns:
True if the value is set, false otherwise.

setNoOp

public void setNoOp(boolean noOp)
Call this method to set noOp. It should be called even by internal methods so that the object can determine if the value has been set or whether it just holds the default value.

Parameters:
noOp -

isNoOpSet

public boolean isNoOpSet()
Determine if the noOp value has been set. This should be called if you want to know whether false for noOp means that it is the default value (i.e. no code has set it) or it is a value that has been actively set.

Returns:
True if the value has been set. Otherwise, false.

getVerboseDescription

public String getVerboseDescription()
Get the Verbose Description for this entry.

Returns:
The description.

setVerboseDescription

public void setVerboseDescription(String verboseDescription)
Set the verbose description.

Parameters:
verboseDescription - The description.

getTreatment

public String getTreatment()
Get the treatment value.

Returns:
The treatment.

setTreatment

public void setTreatment(String treatment)
Set the treatment value.

Parameters:
treatment - The treatment.

getUserAgent

public String getUserAgent()
Get the user agent

Returns:
the user agent

setUserAgent

public void setUserAgent(String userAgent)
Set the user agent

Parameters:
userAgent - the user agent

getPackaging

public String getPackaging()
Get the packaging format

Returns:
the packaging format

setPackaging

public void setPackaging(String packaging)
Set the packaging format

Parameters:
packaging - the packaging format

marshallElements

protected void marshallElements(nu.xom.Element entry)
Overrides:
marshallElements in class Entry

unmarshallWithValidation

public SwordValidationInfo unmarshallWithValidation(nu.xom.Element entry,
                                                    Properties validationProperties)
                                             throws UnmarshallException
Overrides the unmarshall method in the parent Entry. This will call the parent method to parse the general Atom elements and attributes. This method will then parse the remaining sword extensions that exist in the element.

Parameters:
entry - The entry to parse.
Throws:
UnmarshallException - If the entry is not an atom:entry or if there is an exception extracting the data.

unmarshall

public SwordValidationInfo unmarshall(nu.xom.Element entry,
                                      Properties validationProperties)
                               throws UnmarshallException
Overrides:
unmarshall in class Entry
Throws:
UnmarshallException

isElementChecked

protected boolean isElementChecked(XmlName elementName)
Overrides:
isElementChecked in class Entry
Parameters:
elementName -
Returns:

validate

public SwordValidationInfo validate(Properties validationContext)
Overrides:
validate in class Entry

validate

protected SwordValidationInfo validate(SwordValidationInfo info,
                                       Properties validationContext)
Overrides:
validate in class Entry
Returns:

unmarshall

public void unmarshall(nu.xom.Element entry)
                throws UnmarshallException
Overrides the unmarshall method in the parent Entry. This will call the parent method to parse the general Atom elements and attributes. This method will then parse the remaining sword extensions that exist in the element.

Specified by:
unmarshall in interface SwordElementInterface
Overrides:
unmarshall in class Entry
Parameters:
entry - The entry to parse.
Throws:
UnmarshallException - If the entry is not an atom:entry or if there is an exception extracting the data.


Copyright © 2011 DuraSpace. All Rights Reserved.