org.purl.sword.base
Class SwordAcceptPackaging

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

public class SwordAcceptPackaging
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

Field Summary
protected static XmlName ATTRIBUTE_Q_NAME
           
static String ELEMENT_NAME
           
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, DATE_FORMATS, xmlName
 
Constructor Summary
SwordAcceptPackaging()
           
SwordAcceptPackaging(String name, float value)
           
SwordAcceptPackaging(String name, QualityValue value)
           
 
Method Summary
static XmlName elementName()
           
 String getContent()
          Get the content in this TextConstruct.
 QualityValue getQualityValue()
          Get the type.
protected  void initialise()
           
 nu.xom.Element marshall()
          Marshal the data in this object to an Element object.
 void setContent(String content)
          Set the content.
 void setQualityValue(QualityValue value)
          Set the type.
 String toString()
          Get a string representation.
 void unmarshall(nu.xom.Element element)
          Unmarshall the data in the specified element and store it in the object.
 SwordValidationInfo unmarshall(nu.xom.Element acceptPackaging, Properties validationProperties)
          Unmarshal the text element into this object.
protected  SwordValidationInfo validate(List<SwordValidationInfo> existing, List<SwordValidationInfo> attributeItems, Properties validationContext)
           
 SwordValidationInfo validate(Properties validationContext)
           
 
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, wait, wait, wait
 

Field Detail

ELEMENT_NAME

public static final String ELEMENT_NAME
See Also:
Constant Field Values

ATTRIBUTE_Q_NAME

protected static final XmlName ATTRIBUTE_Q_NAME
Constructor Detail

SwordAcceptPackaging

public SwordAcceptPackaging()

SwordAcceptPackaging

public SwordAcceptPackaging(String name,
                            float value)

SwordAcceptPackaging

public SwordAcceptPackaging(String name,
                            QualityValue value)
Method Detail

elementName

public static XmlName elementName()

initialise

protected final void initialise()

marshall

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

Specified by:
marshall in interface SwordElementInterface
Returns:
The data expressed in an Element.

unmarshall

public SwordValidationInfo unmarshall(nu.xom.Element acceptPackaging,
                                      Properties validationProperties)
                               throws UnmarshallException
Unmarshal 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:
acceptPackaging - The text element.
validationProperties -
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(List<SwordValidationInfo> existing,
                                       List<SwordValidationInfo> attributeItems,
                                       Properties validationContext)
Parameters:
existing -
attributeItems -
Returns:

getContent

public final String getContent()
Get the content in this TextConstruct.

Returns:
The content, expressed as a string.

setContent

public final void setContent(String content)
Set the content. This only supports text content.

Parameters:
content - The content.

getQualityValue

public final QualityValue getQualityValue()
Get the type.

Returns:
The type.

setQualityValue

public final void setQualityValue(QualityValue value)
Set the type.

Parameters:
value - The type.

toString

public String toString()
Get a string representation.

Overrides:
toString in class Object
Returns:
The string.


Copyright © 2011 DuraSpace. All Rights Reserved.