org.purl.sword.base
Class SWORDErrorDocument

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

public class SWORDErrorDocument
extends SWORDEntry

Extension of the SWORD Entry class, specialized for Error Documents.

Author:
Stuart Lewis (sdl@aber.ac.uk), Neil Taylor (nst@aber.ac.uk)

Field Summary
static String ELEMENT_NAME
          Deprecated. 
 
Fields inherited from class org.purl.sword.base.SWORDEntry
swordNoOp, swordTreatment, swordUserAgent, swordVerboseDescription
 
Fields inherited from class org.purl.sword.atom.Entry
ELEMENT_CATEGORY, ELEMENT_GENERATOR, ELEMENT_ID, ELEMENT_PUBLISHED, ELEMENT_UPDATED
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, DATE_FORMATS, xmlName
 
Constructor Summary
SWORDErrorDocument()
          Create the error document (intended to be used when unmarshalling an error document as this will set the errorURI)
SWORDErrorDocument(String errorURI)
          Create the error document
 
Method Summary
static XmlName elementName()
          Get the element name.
 String getErrorURI()
          Get the error URI
protected  void initialise()
           
protected  boolean isElementChecked(XmlName elementName)
           
 nu.xom.Element marshall()
          Overrides the marshall method in the parent SWORDEntry.
protected  void processUnexpectedAttributes(nu.xom.Element element, SwordValidationInfo info)
          This method overrides the XmlElement definition so that it can allow the definition of the href attribute.
 void setErrorURI(String error)
          set the error URI
 void unmarshall(nu.xom.Element entry)
          Overrides the unmarshall method in the parent SWORDEntry.
 SwordValidationInfo unmarshall(nu.xom.Element entry, Properties validationProperties)
           
 SwordValidationInfo validate(Properties validationContext)
           
protected  SwordValidationInfo validate(SwordValidationInfo info, Properties validationContext)
           
 
Methods inherited from class org.purl.sword.base.SWORDEntry
getPackaging, getTreatment, getUserAgent, getVerboseDescription, isNoOp, isNoOpSet, marshallElements, setNoOp, setPackaging, setTreatment, setUserAgent, setVerboseDescription, unmarshallWithValidation
 
Methods inherited from class org.purl.sword.atom.Entry
addAuthors, addCategory, addContributor, addLink, clearAuthors, clearCategories, clearContributors, clearLinks, getAuthors, getCategories, getContent, getContributors, getGenerator, getId, getLinks, getPublished, getRights, getSource, getSummary, getTitle, getUpdated, 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, 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 for the element.

See Also:
Constant Field Values
Constructor Detail

SWORDErrorDocument

public SWORDErrorDocument()
Create the error document (intended to be used when unmarshalling an error document as this will set the errorURI)


SWORDErrorDocument

public SWORDErrorDocument(String errorURI)
Create the error document

Parameters:
errorURI - The URI of the error
Method Detail

elementName

public static XmlName elementName()
Get the element name.

Returns:

initialise

protected void initialise()
Overrides:
initialise in class SWORDEntry

marshall

public nu.xom.Element marshall()
Overrides the marshall method in the parent SWORDEntry. This will call the parent marshall method and then add the additional elements that have been added in this subclass.

Specified by:
marshall in interface SwordElementInterface
Overrides:
marshall in class SWORDEntry
Returns:
An element that holds the data associated with this object.

unmarshall

public void unmarshall(nu.xom.Element entry)
                throws UnmarshallException
Overrides the unmarshall method in the parent SWORDEntry. 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 SWORDEntry
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 SWORDEntry
Parameters:
entry -
validationProperties -
Returns:
Throws:
UnmarshallException

processUnexpectedAttributes

protected void processUnexpectedAttributes(nu.xom.Element element,
                                           SwordValidationInfo info)
This method overrides the XmlElement definition so that it can allow the definition of the href attribute. All other attributes are shown as 'Unknown Attribute' info elements.

Overrides:
processUnexpectedAttributes in class XmlElement
Parameters:
element - The element that contains the attributes
info - The info object that will hold the validation info.

isElementChecked

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

validate

public SwordValidationInfo validate(Properties validationContext)
Overrides:
validate in class SWORDEntry
Returns:

validate

protected SwordValidationInfo validate(SwordValidationInfo info,
                                       Properties validationContext)
Overrides:
validate in class SWORDEntry
Parameters:
elements -
attributes -
Returns:

getErrorURI

public String getErrorURI()
Get the error URI

Returns:
the error URI

setErrorURI

public void setErrorURI(String error)
set the error URI

Parameters:
error - the error URI


Copyright © 2009 The DSpace Foundation. All Rights Reserved.