org.intuitel.merger
public abstract class Serializer extends Object
The Serializer class defines two methods: marshall and unmarshall. The former is used to generate XML content representing a given SLOM object. The latter is used to read XML content and create a SLOM object with the information read.
Subclasses of Serializer implement those methods and accomodate the proccess to the particular needs of the XML format in use. As different serialization formats require the use of different subclasses of Serializer, a SerializerFactory should be used to obtain the required Serializer.
SerializerFactory
Constructor and Description |
---|
Serializer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
marshall(SLOM theSlom,
Iterator<OutputStream> it)
Writes the information stored in a SLOM object in a OutputStream.
|
abstract SLOM |
unmarshall(Set<File> inputCourse)
Reads content from a file and returns a SLOM object with the information read.
|
public abstract SLOM unmarshall(Set<File> inputCourse) throws BadFileException, IOException
The unmarshall method reads content from a file and returns a SLOM object with the information read.
The method accepts a Set of File objects, but in most cases the Set will only contain a single File. This is to support those cases in which the information require several files to be complete.
Currently supported input formats are SCORM, SLOM, IMSLD and Semantic Media Wiki
inputCourse
- A Set of files containing the course information in the desired formatBadFileException
IOException
public abstract void marshall(SLOM theSlom, Iterator<OutputStream> it) throws InvalidParameterException, IOException
The marshall method serializes a SLOM object using the serialization supported by the subclass of Serializer that is being used.
The method accepts the SLOM object to be serialized, and a Iterator of OutputStream objects. In the case of IMSLD and SCORM, for instance, only one OutputStream is required since all the information fits in the imsmanifest.xml file. In the case of SLOM, two OutputStream are required, to store the CM and the CCM respectively.
The method returns nothing, since the generated information is written in the OutputStream objects passed as parameter.
Currently supported input formats are SCORM, SLOM and IMSLD. Marshalling is not supported for Semantic Media Wiki
theSlom
- A SLOM object containing the information to be serializedit
- A Iterator of OutputStream objects, that will be used to write the serializationInvalidParameterException
IOException
Copyright © 2014. All rights reserved.