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


Java BinaryResourceImpl.EObjectOutputStream方法代码示例

本文整理汇总了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);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:19,代码来源:QualifiedNameTest.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:BatchLinkableResourceStorageWritable.java

示例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);
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:30,代码来源:BatchLinkableResourceStorageWritable.java

示例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();
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:31,代码来源:ResourceStorageWritable.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:ResourceStorageWritable.java

示例6: handleSaveEObject

import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
protected void handleSaveEObject(final InternalEObject object, final BinaryResourceImpl.EObjectOutputStream out) throws IOException {
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:3,代码来源:ResourceStorageWritable.java


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