org.purl.sword.base
Class BasicContentElement
java.lang.Object
org.purl.sword.base.XmlElement
org.purl.sword.base.BasicContentElement
- All Implemented Interfaces:
- SwordElementInterface
- Direct Known Subclasses:
- BasicBooleanContentElement, BasicIntegerContentElement, BasicStringContentElement
public abstract class BasicContentElement
- extends XmlElement
- implements SwordElementInterface
Represents a text construct in the ATOM elements. This is a superclass of
several elements within this implementation.
- Author:
- Neil Taylor
| 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 |
BasicContentElement
public BasicContentElement(String prefix,
String name,
String namespaceUri)
BasicContentElement
public BasicContentElement(XmlName name)
marshall
public nu.xom.Element marshall()
- Marshall the data in this object to an Element object.
- Specified by:
marshall in interface SwordElementInterface
- Returns:
- The data expressed in an Element.
marshallContent
protected abstract void marshallContent(nu.xom.Element element)
unmarshall
public SwordValidationInfo unmarshall(nu.xom.Element element,
Properties validationProperties)
throws UnmarshallException
- Unmarshall the text element into this object.
This unmarshaller only handles plain text content, although it can
recognise the three different type elements of text, html and xhtml. This
is an area that can be improved in a future implementation, if necessary.
- Parameters:
text - The text element.
- Throws:
UnmarshallException - If the specified element is not of
the correct type, where the localname is used
to specify the valid name. Also thrown
if there is an issue accessing the data.
unmarshall
public void unmarshall(nu.xom.Element element)
throws UnmarshallException
- Description copied from interface:
SwordElementInterface
- Unmarshall the data in the specified element and store it
in the object.
- Specified by:
unmarshall in interface SwordElementInterface
- Parameters:
element - The data to unmarshall.
- Throws:
UnmarshallException - If the element is not of the
correct type, or if there is an error unmarshalling the data.
validate
public SwordValidationInfo validate(Properties validationContext)
- Specified by:
validate in class XmlElement
validate
protected SwordValidationInfo validate(ArrayList<SwordValidationInfo> existing,
ArrayList<SwordValidationInfo> attributeItems,
Properties validationContext)
- Parameters:
existing - attributeItems -
- Returns:
unmarshallContent
protected abstract void unmarshallContent(nu.xom.Element element)
throws UnmarshallException
- Throws:
UnmarshallException
validateContent
protected abstract SwordValidationInfo validateContent(Properties validationContext)
getContentAsString
protected abstract String getContentAsString()
Copyright © 2009 The DSpace Foundation. All Rights Reserved.