本文整理汇总了Java中org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.EObjectOutputStream方法的典型用法代码示例。如果您正苦于以下问题:Java BinaryResourceImpl.EObjectOutputStream方法的具体用法?Java BinaryResourceImpl.EObjectOutputStream怎么用?Java BinaryResourceImpl.EObjectOutputStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl
的用法示例。
在下文中一共展示了BinaryResourceImpl.EObjectOutputStream方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDeserializeAsLowerCase
import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
@Test public void testDeserializeAsLowerCase() throws IOException {
QualifiedName upperCase = QualifiedName.create("A", "B");
QualifiedName lowerCase = upperCase.toLowerCase();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
EObjectOutputStream out = new BinaryResourceImpl.EObjectOutputStream(bos, Collections.emptyMap());
upperCase.writeToStream(out);
lowerCase.writeToStream(out);
out.flush();
EObjectInputStream in = new BinaryResourceImpl.EObjectInputStream(new ByteArrayInputStream(bos.toByteArray()), Collections.emptyMap());
QualifiedName readUpperCase = QualifiedName.createFromStream(in);
QualifiedName readLowerCase = QualifiedName.createFromStream(in);
assertEquals(QualifiedName.class.getName(), readUpperCase.getClass().getName());
assertEquals(QualifiedName.class.getName() + "$QualifiedNameLowerCase", readLowerCase.getClass().getName());
assertEquals(upperCase, readUpperCase);
assertEquals(lowerCase, readLowerCase);
}
示例2: beforeSaveEObject
import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
@Override
protected Object beforeSaveEObject(final InternalEObject object, final BinaryResourceImpl.EObjectOutputStream writable) throws IOException {
JvmType _xblockexpression = null;
{
super.beforeSaveEObject(object, writable);
JvmType _xifexpression = null;
if ((object instanceof XComputedTypeReference)) {
_xifexpression = ((XComputedTypeReference)object).getType();
}
_xblockexpression = _xifexpression;
}
return _xblockexpression;
}
示例3: handleSaveEObject
import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
@Override
protected void handleSaveEObject(final InternalEObject object, final BinaryResourceImpl.EObjectOutputStream out) throws IOException {
super.handleSaveEObject(object, out);
DocumentationAdapter documentationAdapter = null;
JvmIdentifiableMetaData metaDataAdapter = null;
EList<Adapter> _eAdapters = object.eAdapters();
for (final Adapter adapter : _eAdapters) {
{
if ((adapter instanceof DocumentationAdapter)) {
documentationAdapter = ((DocumentationAdapter)adapter);
}
if ((adapter instanceof JvmIdentifiableMetaData)) {
metaDataAdapter = ((JvmIdentifiableMetaData)adapter);
}
}
}
if ((documentationAdapter != null)) {
out.writeBoolean(true);
out.writeString(documentationAdapter.getDocumentation());
} else {
out.writeBoolean(false);
}
if ((metaDataAdapter != null)) {
out.writeBoolean(true);
out.writeBoolean(metaDataAdapter.isSynthetic());
} else {
out.writeBoolean(false);
}
}
示例4: writeContents
import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
protected void writeContents(final StorageAwareResource storageAwareResource, final OutputStream outputStream) throws IOException {
Map<Object, Object> _emptyMap = CollectionLiterals.<Object, Object>emptyMap();
final BinaryResourceImpl.EObjectOutputStream out = new BinaryResourceImpl.EObjectOutputStream(outputStream, _emptyMap) {
@Override
public void writeURI(final URI uri, final String fragment) throws IOException {
final URI fullURI = uri.appendFragment(fragment);
URI _elvis = null;
URI _portableURI = storageAwareResource.getPortableURIs().toPortableURI(storageAwareResource, fullURI);
if (_portableURI != null) {
_elvis = _portableURI;
} else {
_elvis = fullURI;
}
final URI uriToWrite = _elvis;
super.writeURI(uriToWrite.trimFragment(), uriToWrite.fragment());
}
@Override
public void saveEObject(final InternalEObject internalEObject, final BinaryResourceImpl.EObjectOutputStream.Check check) throws IOException {
ResourceStorageWritable.this.beforeSaveEObject(internalEObject, this);
super.saveEObject(internalEObject, check);
ResourceStorageWritable.this.handleSaveEObject(internalEObject, this);
}
};
try {
out.saveResource(storageAwareResource);
} finally {
out.flush();
}
}
示例5: beforeSaveEObject
import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
protected Object beforeSaveEObject(final InternalEObject object, final BinaryResourceImpl.EObjectOutputStream writable) throws IOException {
return null;
}
示例6: handleSaveEObject
import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
protected void handleSaveEObject(final InternalEObject object, final BinaryResourceImpl.EObjectOutputStream out) throws IOException {
}