• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SerializerException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: writeEClass

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEClass(IdEObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object referencedObject = object.eGet(feature);
	if (referencedObject instanceof IdEObject && ((IdEObject)referencedObject).eClass().getEAnnotation("wrapped") != null) {
		writeWrappedValue(object, feature, ((EObject)referencedObject).eClass());
	} else {
		if (referencedObject instanceof EObject && model.contains((IdEObject) referencedObject)) {
			print(DASH);
			print(String.valueOf(getExpressId((IdEObject) referencedObject)));
		} else {
			EntityDefinition entityBN = getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName());
			if (entityBN != null && entityBN.isDerived(feature.getName())) {
				print(ASTERISK);
			} else if (feature.isMany()) {
				writeList(object, feature);
			} else {
				writeObject(object, feature);
			}
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:21,代码来源:IfcStepSerializer.java


示例2: writeEnum

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEnum(EObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object val = object.eGet(feature);
	if (feature.getEType().getName().equals("Tristate")) {
		IfcParserWriterUtils.writePrimitive(val, outputStream);
	} else {
		if (val == null) {
			print(DOLLAR);
		} else {
			if (((Enum<?>) val).toString().equals(NULL)) {
				print(DOLLAR);
			} else {
				print(DOT);
				print(val.toString());
				print(DOT);
			}
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:19,代码来源:IfcStepSerializer.java


示例3: processMode

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private boolean processMode() throws IOException, BimserverDatabaseException, SerializerException {
	if (getMode() == Mode.HEADER) {
		writeHeader();
		setMode(Mode.BODY);
	} else if (getMode() == Mode.BODY) {
		HashMapVirtualObject next = objectProvider.next();
		if (next != null) {
			write(next);
		} else {
			setMode(Mode.FOOTER);
		}
	} else if (getMode() == Mode.FOOTER) {
		writeFooter();
		setMode(Mode.FINISHED);
		if (printWriter != null) {
			printWriter.flush();
		}
	} else if (getMode() == Mode.FINISHED) {
		return false;
	}
	return true;
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:23,代码来源:IfcStepStreamingSerializer.java


示例4: writeEClass

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEClass(HashMapVirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object referencedObject = object.eGet(feature);
	if (referencedObject instanceof AbstractHashMapVirtualObject && ((AbstractHashMapVirtualObject)referencedObject).eClass().getEAnnotation("wrapped") != null) {
		writeWrappedValue(object, feature, ((AbstractHashMapVirtualObject)referencedObject).eClass());
	} else {
		if (referencedObject instanceof Long) {
			if (object.useFeatureForSerialization(feature)) {
				print(DASH);
				print(String.valueOf(getExpressId((Long) referencedObject)));
			} else {
				print(DOLLAR);
			}
		} else {
			EntityDefinition entityBN = getSchemaDefinition().getEntityBN(object.eClass().getName());
			if (entityBN != null && entityBN.isDerived(feature.getName())) {
				print(ASTERISK);
			} else if (feature.isMany()) {
				writeList(object, feature);
			} else {
				writeObject(object, feature);
			}
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:25,代码来源:IfcStepStreamingSerializer.java


示例5: writeEmbedded

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEmbedded(HashMapWrappedVirtualObject eObject) throws SerializerException, IOException {
	EClass class1 = eObject.eClass();
	print(packageMetaData.getUpperCase(class1));
	print(OPEN_PAREN);
	EStructuralFeature structuralFeature = class1.getEStructuralFeature(WRAPPED_VALUE);
	if (structuralFeature != null) {
		Object realVal = eObject.eGet(structuralFeature);
		if (structuralFeature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
			EStructuralFeature asStringFeature = eObject.eClass().getEStructuralFeature(structuralFeature.getName() + "AsString");
			String asString = (String) eObject.eGet(asStringFeature);
			writeDoubleValue((Double)realVal, asString, structuralFeature);
		} else {
			IfcParserWriterUtils.writePrimitive(realVal, printWriter);
		}
	}
	print(CLOSE_PAREN);
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:18,代码来源:IfcStepStreamingSerializer.java


示例6: writeEnum

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEnum(HashMapVirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object val = object.eGet(feature);
	if (feature.getEType().getName().equals("Tristate")) {
		if (val == null) {
			print(DOLLAR);
		} else {
			IfcParserWriterUtils.writePrimitive(val, printWriter);
		}
	} else {
		if (val == null) {
			print(DOLLAR);
		} else {
			if (((Enum<?>) val).toString().equals(NULL)) {
				print(DOLLAR);
			} else {
				print(DOT);
				print(val.toString());
				print(DOT);
			}
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:23,代码来源:IfcStepStreamingSerializer.java


示例7: write

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
@Override
public boolean write(OutputStream out) throws SerializerException {
  if (getMode() == Mode.BODY) {
    OutputStreamWriter outputStreamWriter = new OutputStreamWriter(out, Charsets.UTF_8);
    JsonWriter jsonWriter = new JsonWriter(new BufferedWriter(outputStreamWriter));
    try {
      calculateLengthUnitConversion();
      mapObjectMaterials();
      writeIfcGeometryTree(jsonWriter);
      jsonWriter.flush();
    } catch (Exception e) {
      log.severe(e.getMessage());
    }
    setMode(Mode.FINISHED);
    return true;
  } else if (getMode() == Mode.FINISHED) {
    return false;
  }
  return false;
}
 
开发者ID:urbanetic,项目名称:geotree-bimserver-plugin,代码行数:21,代码来源:JsonIfcGeometryTreeSerializer.java


示例8: read

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
@Override
public int read() throws IOException {
	try {
		if (buffer != null && pos < buffer.length) {
			return buffer[pos++];
		} else {
			buffer = null;
			while (buffer == null) {
				out.reset();
				boolean write = messagingStreamingSerializer.writeMessage(out, null);
				byte[] newBuffer = out.toByteArray();
				if (newBuffer.length > 0) {
					buffer = newBuffer;
					pos = 1;
					return buffer[0];
				}
				if (!write) {
					return -1;
				}
			}
		}
		return 0;
	} catch (SerializerException e) {
		throw new IOException(e);
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:27,代码来源:MessagingSerializerInputstream.java


示例9: write

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
@Override
public boolean write(OutputStream outputStream, ProgressReporter progressReporter) throws SerializerException {
	if (getMode() == Mode.BODY) {
		PrintWriter out = new PrintWriter(outputStream);
		for (EObject eObject : model.getObjects().values()) {
			if (eObject.eClass().getEAnnotation("hidden") == null) {
				writeTable(out, eObject);
			}
		}
		out.flush();
		setMode(Mode.FINISHED);
		return true;
	} else if (getMode() == Mode.FINISHED) {
		return false;
	}
	return false;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:18,代码来源:ObjectInfoSerializer.java


示例10: write

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
public boolean write(OutputStream outputStream, ProgressReporter progressReporter) throws SerializerException {
	try {
		this.outputStream = outputStream;
		if (getMode() == Mode.HEADER) {
			writeHeader();
			setMode(Mode.BODY);
			iterator = model.getValues().iterator();
			return true;
		} else if (getMode() == Mode.BODY) {
			if (iterator.hasNext()) {
				write(iterator.next());
				writeCounter++;
				if (progressReporter != null) {
					progressReporter.update(writeCounter, model.size());
				}
			} else {
				iterator = null;
				setMode(Mode.FOOTER);
				return write(outputStream, progressReporter);
			}
			return true;
		} else if (getMode() == Mode.FOOTER) {
			writeFooter();
			if (progressReporter != null) {
				progressReporter.update(model.size(), model.size());
			}
			setMode(Mode.FINISHED);
			return true;
		} else if (getMode() == Mode.FINISHED) {
			return false;
		}			
		return false;
	} catch (IOException e) {
		throw new SerializerException(e);
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:37,代码来源:IfcStepSerializer.java


示例11: writeEDataType

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEDataType(IdEObject object, EntityDefinition entityBN, EStructuralFeature feature) throws SerializerException, IOException {
	if (entityBN != null && entityBN.isDerived(feature.getName())) {
		print(ASTERISK);
	} else if (feature.isMany()) {
		writeList(object, feature);
	} else {
		writeObject(object, feature);
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:10,代码来源:IfcStepSerializer.java


示例12: writeObject

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeObject(IdEObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object ref = object.eGet(feature);
	if (ref == null || (feature.isUnsettable() && !object.eIsSet(feature))) {
		EClassifier type = feature.getEType();
		if (type instanceof EClass) {
			EStructuralFeature structuralFeature = ((EClass) type).getEStructuralFeature(WRAPPED_VALUE);
			if (structuralFeature != null) {
				String name = structuralFeature.getEType().getName();
				if (name.equals(IFC_BOOLEAN) || name.equals(IFC_LOGICAL) || structuralFeature.getEType() == EcorePackage.eINSTANCE.getEBoolean()) {
					print(BOOLEAN_UNDEFINED);
				} else {
					print(DOLLAR);
				}
			} else {
				print(DOLLAR);
			}
		} else {
			if (type == EcorePackage.eINSTANCE.getEBoolean()) {
				print(BOOLEAN_UNDEFINED);
			} else if (feature.isMany()) {
				print("()");
			} else {
				print(DOLLAR);
			}
		}
	} else {
		if (ref instanceof EObject) {
			writeEmbedded((EObject) ref);
		} else if (feature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
			writeDoubleValue((Double)ref, object, feature);
		} else {
			IfcParserWriterUtils.writePrimitive(ref, outputStream);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:36,代码来源:IfcStepSerializer.java


示例13: writeDoubleValue

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeDoubleValue(double value, EObject object, EStructuralFeature feature) throws SerializerException, IOException {
	if (model.isUseDoubleStrings()) {
		Object stringValue = object.eGet(object.eClass().getEStructuralFeature(feature.getName() + "AsString"));
		if (stringValue != null) {
			print((String)stringValue);
			return;
		}
	}
	IfcParserWriterUtils.writePrimitive(value, outputStream);
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:11,代码来源:IfcStepSerializer.java


示例14: writeEmbedded

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEmbedded(EObject eObject) throws SerializerException, IOException {
	EClass class1 = eObject.eClass();
	print(getPackageMetaData().getUpperCase(class1));
	print(OPEN_PAREN);
	EStructuralFeature structuralFeature = class1.getEStructuralFeature(WRAPPED_VALUE);
	if (structuralFeature != null) {
		Object realVal = eObject.eGet(structuralFeature);
		if (structuralFeature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
			writeDoubleValue((Double)realVal, eObject, structuralFeature);
		} else {
			IfcParserWriterUtils.writePrimitive(realVal, outputStream);
		}
	}
	print(CLOSE_PAREN);
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:16,代码来源:IfcStepSerializer.java


示例15: write

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
@Override
public boolean write(OutputStream outputStream) throws SerializerException, BimserverDatabaseException {
	if (this.printWriter == null) {
		this.printWriter = new UTF8PrintWriter(outputStream);
	}
	boolean result = false;
	try {
		result = processMode();
	} catch (IOException e) {
		throw new SerializerException(e);
	}
	return result;
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:14,代码来源:IfcStepStreamingSerializer.java


示例16: writeToOutputStream

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
public void writeToOutputStream(OutputStream outputStream) throws SerializerException, BimserverDatabaseException {
	this.printWriter = new UTF8PrintWriter(outputStream);
	try {
		while (mode != Mode.FINISHED) {
			processMode();			
		}
	} catch (IOException e) {
		throw new SerializerException(e);
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:11,代码来源:IfcStepStreamingSerializer.java


示例17: writeEDataType

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeEDataType(HashMapVirtualObject object, EntityDefinition entityBN, EStructuralFeature feature) throws SerializerException, IOException {
	if (entityBN != null && entityBN.isDerived(feature.getName())) {
		print(ASTERISK);
	} else if (feature.isMany()) {
		writeList(object, feature);
	} else {
		writeObject(object, feature);
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:10,代码来源:IfcStepStreamingSerializer.java


示例18: writeObject

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeObject(HashMapVirtualObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object ref = object.eGet(feature);
	if (ref == null || (feature.isUnsettable() && !object.eIsSet(feature))) {
		EClassifier type = feature.getEType();
		if (type instanceof EClass) {
			EStructuralFeature structuralFeature = ((EClass) type).getEStructuralFeature(WRAPPED_VALUE);
			if (structuralFeature != null) {
				String name = structuralFeature.getEType().getName();
				if (name.equals(IFC_BOOLEAN) || name.equals(IFC_LOGICAL) || structuralFeature.getEType() == EcorePackage.eINSTANCE.getEBoolean()) {
					print(BOOLEAN_UNDEFINED);
				} else {
					print(DOLLAR);
				}
			} else {
				print(DOLLAR);
			}
		} else {
			if (type == EcorePackage.eINSTANCE.getEBoolean()) {
				print(BOOLEAN_UNDEFINED);
			} else if (feature.isMany()) {
				print("()");
			} else {
				print(DOLLAR);
			}
		}
	} else {
		if (ref instanceof HashMapWrappedVirtualObject) {
			writeEmbedded((HashMapWrappedVirtualObject) ref);
		} else if (feature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
			EStructuralFeature asStringFeature = object.eClass().getEStructuralFeature(feature.getName() + "AsString");
			String asString = (String) object.eGet(asStringFeature);
			writeDoubleValue((Double)ref, asString, feature);
		} else {
			IfcParserWriterUtils.writePrimitive(ref, printWriter);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:38,代码来源:IfcStepStreamingSerializer.java


示例19: writeDoubleValue

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
private void writeDoubleValue(double value, String asString, EStructuralFeature feature) throws SerializerException, IOException {
	if (asString != null) {
		print((String)asString);
		return;
	}
	IfcParserWriterUtils.writePrimitive(value, printWriter);
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:8,代码来源:IfcStepStreamingSerializer.java


示例20: init

import org.bimserver.plugins.serializers.SerializerException; //导入依赖的package包/类
@Override
public void init(IfcModelInterface model, ProjectInfo projectInfo, boolean normalizeOids) throws SerializerException {
	super.init(model, projectInfo, normalizeOids);
	objectToOidMap = new HashMap<EObject, Long>((int) model.size());
	for (Long key : model.keySet()) {
		objectToOidMap.put(model.get(key), key);
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:9,代码来源:IfcXmlSerializer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FastMath类代码示例发布时间:2022-05-23
下一篇:
Java DatastoreTimeoutException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap