use of eu.esdihumboldt.hale.common.core.io.project.model.internal.generated.ObjectFactory in project hale by halestudio.
the class JaxbProjectIO method save.
/**
* Save a project to an output stream.
*
* @param project the project to save
* @param out the output stream
* @throws Exception if converting or writing the alignment fails
*/
public static void save(Project project, OutputStream out) throws Exception {
ProjectType projType = ProjectToJaxb.convert(project);
JAXBContext jc = JAXBContext.newInstance(PROJECT_CONTEXT, ObjectFactory.class.getClassLoader());
Marshaller m = jc.createMarshaller();
// Indent output
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
// set encoding
m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
// Specify the schema location
// m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
// "http://knowledgeweb.semanticweb.org/heterogeneity/alignment align.xsd");
ObjectFactory of = new ObjectFactory();
try {
m.marshal(of.createHaleProject(projType), out);
} finally {
out.flush();
out.close();
}
}
Aggregations