Serializer Plugin

Ruben de Laat edited this page Jul 10, 2013 · 5 revisions

A serializer serializes an object model to a stream of data. Among the default serializers are: IFC2x3, IfcXml, CityGML and others. Most serializers will output a textbased format but that is not required.

Serializer plugins must implement SerializerPlugin interface

public interface SerializerPlugin extends Plugin {
	/**
	 * @return A serializer
	 */
	Serializer createSerializer(PluginConfiguration plugin);

	/**
	 * @return Whether this plugin will be needing geometry
	 */
	boolean needsGeometry();
}
public interface Serializer {
	void init(IfcModelInterface model, ProjectInfo projectInfo, PluginManager pluginManager, RenderEnginePlugin renderEnginePlugin, boolean normalizeOids) throws SerializerException;
	void writeToFile(File file) throws SerializerException;
	byte[] getBytes();
	IfcModelInterface getModel();
	InputStream getInputStream() throws IOException;
	void writeToOutputStream(OutputStream outputStream) throws SerializerException;
	void reset();
}

You can subclass EmfSerializer so you don't have to implement all methods.

You can subclass AbstractGeometrySerializer if your serializer is going to need triangulated geometry.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.