当前位置: 首页>>代码示例>>Java>>正文


Java Deserializer类代码示例

本文整理汇总了Java中org.bimserver.plugins.deserializers.Deserializer的典型用法代码示例。如果您正苦于以下问题:Java Deserializer类的具体用法?Java Deserializer怎么用?Java Deserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Deserializer类属于org.bimserver.plugins.deserializers包,在下文中一共展示了Deserializer类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAllContentsSet

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Set<IHawkObject> getAllContentsSet() {
	if (allElements == null) {
		allElements = new HashSet<IHawkObject>();

		try {
			Deserializer d = createDeserializer();
			IfcModelInterface s = readModel(d);
			for (IdEObject eo : s.getValues()) {
				allElements.add(new IFCObject(eo));
				addFloating(allElements, eo);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	return allElements;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:20,代码来源:IFCAbstractModelResource.java

示例2: start

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
private void start() {
	Path src = TestFile.RIOLERING_TEST.getFile();
	PluginManager pluginManager;
	try {
		pluginManager = LocalDevPluginLoader.createPluginManager(Paths.get("home"));
		DeserializerPlugin deserializerPlugin = pluginManager.getFirstDeserializer("ifc", Schema.IFC2X3TC1, true);
		Deserializer deserializer = deserializerPlugin.createDeserializer(new PluginConfiguration());
		deserializer.init(pluginManager.getMetaDataManager().getPackageMetaData("ifc2x3tc1"));
		try {
			model = DeserializerUtils.readFromFile(deserializer, src);
		} catch (Exception e) {
			e.printStackTrace();
		}
		step1();
	} catch (PluginException e1) {
		e1.printStackTrace();
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:19,代码来源:IfcRioleringTest.java

示例3: readModel

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
public IfcModelInterface readModel(Path file) {
	PluginManager pluginManager;
	try {
		pluginManager = LocalDevPluginLoader.createPluginManager(Paths.get("home"));
		DeserializerPlugin deserializerPlugin = pluginManager.getFirstDeserializer("ifc", Schema.IFC2X3TC1, true);
		Deserializer deserializer = deserializerPlugin.createDeserializer(new PluginConfiguration());
		deserializer.init(pluginManager.getMetaDataManager().getPackageMetaData("ifc2x3tc1"));
		try {
			IfcModelInterface model = DeserializerUtils.readFromFile(deserializer, file);
			return model;
		} catch (Exception e) {
			e.printStackTrace();
		}
	} catch (PluginException e1) {
		e1.printStackTrace();
	}
	return null;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:19,代码来源:GuidHighlighterTester.java

示例4: readModel

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
protected IfcModelInterface readModel(Deserializer d) throws DeserializeException, IOException {
	// The factory only reports a non-unknown type if the zip has at least
	// one .ifc* file, so this should be safe.
	final ZipEntry first = ifcEntries.get(0);

	return d.read(zipFile.getInputStream(first), first.getName(), first.getSize());
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:9,代码来源:IFCZippedModelResource.java

示例5: createDeserializer

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
private Deserializer createDeserializer() throws Exception {

		Deserializer d;
		String packageLowerCaseName;

		switch (ifcModelType) {
		case IFC2X3_STEP:
			d = new Ifc2x3tc1StepDeserializer(Schema.IFC2X3TC1);
			packageLowerCaseName = Ifc2x3tc1Package.eINSTANCE.getName().toLowerCase();
			break;
		case IFC2X3_XML:
			d = new Ifc2x3tc1XmlDeserializer();
			packageLowerCaseName = Ifc2x3tc1Package.eINSTANCE.getName().toLowerCase();
			break;
		case IFC4_STEP:
			d = new Ifc4StepDeserializer(Schema.IFC4);
			packageLowerCaseName = Ifc4Package.eINSTANCE.getName().toLowerCase();
			break;
		case IFC4_XML:
			d = new Ifc4XmlDeserializer();
			packageLowerCaseName = Ifc4Package.eINSTANCE.getName().toLowerCase();
			break;
		default:
			throw new IllegalArgumentException("Unsupported IFC model type " + ifcModelType);
		}

		PluginManager bimPluginManager = createPluginManager();
		MetaDataManager bimMetaDataManager = new MetaDataManager(bimPluginManager);
		bimMetaDataManager.init();
		final PackageMetaData packageMetaData = bimMetaDataManager.getPackageMetaData(packageLowerCaseName);
		d.init(packageMetaData);
	
		return d;
	}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:35,代码来源:IFCAbstractModelResource.java

示例6: createDeserializer

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Deserializer createDeserializer(PluginConfiguration pluginConfiguration) {
	return new Ifc4StepDeserializer(Schema.IFC4);
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:5,代码来源:Ifc4StepDeserializerPlugin.java

示例7: createDeserializer

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Deserializer createDeserializer(PluginConfiguration pluginConfiguration) {
	return new Ifc2x3tc1StepDeserializer();
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:5,代码来源:Ifc2x3tc1StepDeserializerPlugin.java

示例8: createDeserializer

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Deserializer createDeserializer(PluginConfiguration pluginConfiguration) {
	return new JsonDeserializer();
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:5,代码来源:JsonDeserializerPlugin.java

示例9: readModel

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
protected abstract IfcModelInterface readModel(Deserializer d)
throws DeserializeException, IOException;
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:3,代码来源:IFCAbstractModelResource.java

示例10: readModel

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
protected IfcModelInterface readModel(Deserializer d) throws DeserializeException {
	return d.read(ifc);
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:5,代码来源:IFCModelResource.java

示例11: readFromBytes

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
public static IfcModelInterface readFromBytes(Deserializer deserializer, byte[] bytes, String filename) throws DeserializeException {
	return deserializer.read(new ByteArrayInputStream(bytes), filename, bytes.length, null);
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:4,代码来源:DeserializerUtils.java

示例12: readFromFile

import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
public static IfcModelInterface readFromFile(Deserializer deserializer, Path path) throws DeserializeException, IOException {
	try (InputStream fis = Files.newInputStream(path)) {
		return deserializer.read(fis, path.getFileName().toString(), Files.size(path), null);
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:6,代码来源:DeserializerUtils.java


注:本文中的org.bimserver.plugins.deserializers.Deserializer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。