edu.harvard.hul.ois.mets.helper
Class MetsElement

java.lang.Object
  extended byedu.harvard.hul.ois.mets.helper.MetsElement
All Implemented Interfaces:
MetsSerializable
Direct Known Subclasses:
Any, MetsVElement

public abstract class MetsElement
extends java.lang.Object
implements MetsSerializable

Abstract element class.


Field Summary
protected  Attributes _attrs
          List of attributes.
protected  java.util.List _content
          Element content model.
protected  java.lang.String _localName
          Element local name.
protected  java.lang.String _namespace
          Element namespace.
protected  java.lang.String _qName
          Element qName.
protected  java.util.List _schema
          List of namespace-qualified schema to declare.
 
Constructor Summary
MetsElement()
          Instantiate a name-less MetsElement object.
MetsElement(java.lang.String qName)
          Instantiate a named MetsElement object.
 
Method Summary
 java.util.List getContent()
          Get the element content model.
 java.lang.String getLocalName()
          Get the element local name.
 java.lang.String getNamespace()
          Get the element namespace.
 java.lang.String getQName()
          Get the element QName.
 java.util.List getSchemas()
          Return the list of namespace-qualified schema.
 void init()
          Initialize a MetsElement object with an empty content model.
abstract  void read(MetsReader r)
          De-serialize this element and its content model.
 void setSchema(java.lang.String namespacePrefix, java.lang.String namespaceURI)
          Set additional namespace-qualified schemas to declare.
 void setSchema(java.lang.String namespacePrefix, java.lang.String namespaceURI, java.lang.String locationURI)
          Set additional namespace-qualified schemas to declare.
abstract  void write(MetsWriter w)
          Serialize this element and its content model.
 void writeSchemas(MetsWriter w)
          Serialize any namespace-qualified schemas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_attrs

protected Attributes _attrs
List of attributes.


_content

protected java.util.List _content
Element content model.


_localName

protected java.lang.String _localName
Element local name.


_namespace

protected java.lang.String _namespace
Element namespace.


_qName

protected java.lang.String _qName
Element qName.


_schema

protected java.util.List _schema
List of namespace-qualified schema to declare.

Constructor Detail

MetsElement

public MetsElement()
Instantiate a name-less MetsElement object.


MetsElement

public MetsElement(java.lang.String qName)
Instantiate a named MetsElement object.

Parameters:
qName - Element local name
Method Detail

init

public void init()
Initialize a MetsElement object with an empty content model.


getContent

public java.util.List getContent()
Get the element content model.

Specified by:
getContent in interface MetsSerializable
Returns:
Element content model

getLocalName

public java.lang.String getLocalName()
Get the element local name.

Returns:
Element local name

getNamespace

public java.lang.String getNamespace()
Get the element namespace.

Returns:
Element namespace

getQName

public java.lang.String getQName()
Get the element QName.

Returns:
Element QName

getSchemas

public java.util.List getSchemas()
Return the list of namespace-qualified schema.


setSchema

public void setSchema(java.lang.String namespacePrefix,
                      java.lang.String namespaceURI)
Set additional namespace-qualified schemas to declare. For more than one schema, invoke multiple times. Note: The METS, XLink, and Schema (instance) schemas are defined by default; they should not be added using this method.

Parameters:
namespacePrefix - Schema namespace prefix
namespaceURI - Schema namespace URI

setSchema

public void setSchema(java.lang.String namespacePrefix,
                      java.lang.String namespaceURI,
                      java.lang.String locationURI)
Set additional namespace-qualified schemas to declare. For more than one schema, invoke multiple times. Note: The METS, XLink, and Schema (instance) schemas are defined by default; they should not be added using this method.

Parameters:
namespacePrefix - Schema namespace prefix
namespaceURI - Schema namespace URI
locationURI - Schema location URI

read

public abstract void read(MetsReader r)
                   throws MetsException
De-serialize this element and its content model.

Specified by:
read in interface MetsSerializable
Parameters:
r - Reader
Throws:
MetsException

write

public abstract void write(MetsWriter w)
                    throws MetsException
Serialize this element and its content model.

Specified by:
write in interface MetsSerializable
Parameters:
w - Writer
Throws:
MetsException

writeSchemas

public void writeSchemas(MetsWriter w)
                  throws MetsException
Serialize any namespace-qualified schemas.

Parameters:
w - Writer
Throws:
MetsException