org.w3.atom
Class Content

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

public class Content
extends XmlElement
implements SwordElementInterface

Represents an ATOM Content element.

Author:
Neil Taylor

Field Summary
static String ATTR_SRC
          The identifier for the src attribute.
static String ATTR_TYPE
          The identifier for the type attribute.
 
Fields inherited from class org.purl.sword.base.XmlElement
DATE_FORMAT, localName, prefix
 
Constructor Summary
Content()
          Create a new instance and set the prefix to 'atom' and the local name to 'content'.
 
Method Summary
 String getSource()
          Get the Source.
 String getType()
          Get the type.
 nu.xom.Element marshall()
          Marshall the data in this object to an Element object.
 void setSource(String source)
          Set the Source.
 void setType(String type)
          Set the type for the content.
 void unmarshall(nu.xom.Element content)
          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
 

Field Detail

ATTR_SRC

public static final String ATTR_SRC
The identifier for the src attribute.

See Also:
Constant Field Values

ATTR_TYPE

public static final String ATTR_TYPE
The identifier for the type attribute.

See Also:
Constant Field Values
Constructor Detail

Content

public Content()
Create a new instance and set the prefix to 'atom' and the local name to 'content'.

Method Detail

getSource

public String getSource()
Get the Source.

Returns:
The Source.

setSource

public void setSource(String source)
Set the Source.

Parameters:
source - The source.

getType

public String getType()
Get the type.

Returns:
The type.

setType

public void setType(String type)
             throws InvalidMediaTypeException
Set the type for the content. This should match the pattern ".* /.*" [Note, there is no space before the /, this has been added to allow this text to be written in a Java comment.]. An example of the type is application/zip.

Parameters:
type - The specified type.
Throws:
InvalidMediaTypeException - If the specified type is null or it does not match the specified pattern.

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

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