當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。