|
METS Java Toolkit /
Marshalling / Unmarshalling
The procedure to marshal a METS file is to create an in-memory representation composed of instantiated objects, and invoke the root <mets> class validate() and marshal() methods:
Mets mets = new Mets (); ... mets.validate (); mets.marshal (outputStream); This generates a well-formed and valid METS file on the output stream. The procedure to unmarshal a METS file to an in-memory representation is to instantiate the root <mets> class, and invoke its unmarshal() and validate() methods:
Mets mets = Mets.unmarshal (inputStream); mets.validate (); ... At this point, the entire document is represented by a tree structure of instantiated objects, against which the standard accessor and mutator functions can be invoked.
Stephen Abrams Harvard University Library, Office for Information Systems 1280 Massachusetts Avenue, Suite 404 Cambridge, MA 02138 stephen_abrams@harvard.edu Copyright © 2002 by the President and Fellows of Harvard College. This information about the METS Java Toolkit is provided for evaluation purposes only.
The METS specification
was developed as an initiative of the
Digital Library Federation
and is maintained by the Network Development and
MARC Standards Office of the Library of Congress. |