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

java.lang.Object
  extended byedu.harvard.hul.ois.mets.helper.PCData
All Implemented Interfaces:
MetsSerializable

public class PCData
extends java.lang.Object
implements MetsSerializable

Class encapsulating a PCDATA text string. Note that PCDATA content can be specified as either String or Reader objects.


Constructor Summary
PCData()
          Instantiate a PCData object.
PCData(java.io.Reader reader)
          Instantiate a PCData object with a content reader.
PCData(java.lang.String content)
          Instantiate a PCData object with string content.
 
Method Summary
 void add(java.lang.String content)
          Add additional PCDATA content.
 java.util.List getContent()
          Get content model.
 void read(MetsReader r)
          De-serialize this element and its content model.
static PCData reader(MetsReader r)
          Instantiate a PCData object de-serialized from the input stream.
 void write(MetsWriter w)
          Serialize this element and its content model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PCData

public PCData()
Instantiate a PCData object.


PCData

public PCData(java.lang.String content)
Instantiate a PCData object with string content.

Parameters:
content - String content

PCData

public PCData(java.io.Reader reader)
Instantiate a PCData object with a content reader. Objects instantiated with this constructor must not attempt to add content to the list returned by the getContent() method.

Parameters:
reader - Reader
Method Detail

getContent

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

Specified by:
getContent in interface MetsSerializable
Returns:
Null

add

public void add(java.lang.String content)
Add additional PCDATA content.

Parameters:
content - PCDATA content

reader

public static PCData reader(MetsReader r)
                     throws MetsException
Instantiate a PCData object de-serialized from the input stream.

Parameters:
r - Reader
Returns:
PCData object
Throws:
MetsException - De-serializing exception

read

public 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 void write(MetsWriter w)
           throws MetsException
Serialize this element and its content model.

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