org.intuitel.merger
public class SLOMSerializer extends Serializer
The SLOMSerializer read metadata from a SLOM package and translates it to its internal SLOM representation.
Further information of the transformation details can be found at the INTUITEL project page, at deliverable D4.2
Serializer
,
SerializerFactory
,
SLOM
Constructor and Description |
---|
SLOMSerializer() |
Modifier and Type | Method and Description |
---|---|
String |
isValidSLOM(File SLOM_file)
Determines if the received file contains a SLOM package.
|
void |
marshall(SLOM theSlom,
Iterator<OutputStream> it)
Writes the information stored in a SLOM object in a OutputStream.
|
SLOM |
unmarshall(InputStream cm,
InputStream ccm)
Reads CM and CCM from respective InputStream objects and creates a SLOM object.
|
SLOM |
unmarshall(Set<File> inputCourse)
Reads content from a file and returns a SLOM object with the information read.
|
public SLOM unmarshall(InputStream cm, InputStream ccm) throws BadFileException, IOException
This unmarshalling method is exclusive of the SLOM format. It allows a more efficient usage or resources, since it is expected that software using (i.e. editing or reading) SLOM are more likely to store the CM and CCM rather than the SLOM package itself.
cm
- The Cognitive Model of the SLOM courseccm
- The Content Cognitive Model of the SLOM courseBadFileException
IOException
public 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. In the SLOM case, the Set is expected to contain a single zip file with the SLOM package.
unmarshall
in class Serializer
inputCourse
- A Set of files containing the course information in the desired formatBadFileException
IOException
public void marshall(SLOM theSlom, Iterator<OutputStream> it) throws InvalidParameterException
The marshall method serializes a SLOM object in the OWL/RDF representation
The method accepts the SLOM object to be serialized, and a Iterator of OutputStream objects. 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.
marshall
in class Serializer
theSlom
- A SLOM object containing the information to be serializedit
- A Iterator of OutputStream objects, that will be used to write the serializationInvalidParameterException
public String isValidSLOM(File SLOM_file) throws IOException
The decision is based on the use of the isValidSLOM method provided by SLOM objects.
SLOM_file
- The SLOM package to validate.IOException
SLOM
,
SLOMError
Copyright © 2014. All rights reserved.