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


Java BatchLinkableResource类代码示例

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


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

示例1: ensureLinked

import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
private void ensureLinked() {
	if (!linked) {
		Resource resource = eResource();
		if (resource != null) {
			if (resource instanceof BatchLinkableResource) {
				((BatchLinkableResource) resource).resolveLazyCrossReferences(null);
			} else {
				EcoreUtil.resolveAll(resource);
			}
			linked = true;
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:XClosureImplCustom.java

示例2: loadEntries

import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
@Override
protected void loadEntries(final StorageAwareResource resource, final ZipInputStream zipIn) throws IOException {
  super.loadEntries(resource, zipIn);
  if ((resource instanceof BatchLinkableResource)) {
    this.readAssociationsAdapter(((BatchLinkableResource)resource), zipIn);
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:8,代码来源:BatchLinkableResourceStorageLoadable.java

示例3: writeEntries

import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
@Override
protected void writeEntries(final StorageAwareResource resource, final ZipOutputStream zipOut) throws IOException {
  super.writeEntries(resource, zipOut);
  if ((resource instanceof BatchLinkableResource)) {
    ZipEntry _zipEntry = new ZipEntry("associations");
    zipOut.putNextEntry(_zipEntry);
    final BufferedOutputStream buffOut = new BufferedOutputStream(zipOut);
    try {
      this.writeAssociationsAdapter(((BatchLinkableResource)resource), buffOut);
    } finally {
      buffOut.flush();
      zipOut.closeEntry();
    }
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:16,代码来源:BatchLinkableResourceStorageWritable.java

示例4: testImplicitLambdaParameter

import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
@Test
public void testImplicitLambdaParameter() {
  try {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("{");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("val Comparable<String> c = [ length ]");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("c.toString");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    XExpression _parse = this._parseHelper.parse(_builder);
    final XBlockExpression block = ((XBlockExpression) _parse);
    Resource _eResource = block.eResource();
    final BatchLinkableResource resource = ((BatchLinkableResource) _eResource);
    resource.resolveLazyCrossReferences(null);
    XExpression _head = IterableExtensions.<XExpression>head(block.getExpressions());
    final XVariableDeclaration assignment = ((XVariableDeclaration) _head);
    XExpression _right = assignment.getRight();
    final XClosure lambda = ((XClosure) _right);
    final JvmFormalParameter implicitParameter = IterableExtensions.<JvmFormalParameter>head(lambda.getImplicitFormalParameters());
    Assert.assertEquals("String", implicitParameter.getParameterType().getSimpleName());
    resource.update(0, 0, "");
    Assert.assertNull(implicitParameter.eResource());
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:32,代码来源:BeforeLinkingTest.java

示例5: testImplicitReceiver

import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
@Test
public void testImplicitReceiver() {
  try {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("{");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("val it = \'\'");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("toString");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    XExpression _parse = this._parseHelper.parse(_builder);
    final XBlockExpression block = ((XBlockExpression) _parse);
    Resource _eResource = block.eResource();
    final BatchLinkableResource resource = ((BatchLinkableResource) _eResource);
    XExpression _last = IterableExtensions.<XExpression>last(block.getExpressions());
    final XFeatureCall toString = ((XFeatureCall) _last);
    XExpression _implicitReceiver = toString.getImplicitReceiver();
    final XFeatureCall implicitReceiver = ((XFeatureCall) _implicitReceiver);
    Assert.assertEquals("it", implicitReceiver.getFeature().getSimpleName());
    resource.update(0, 0, "");
    Assert.assertNull(this._reflectExtensions.<Object>get(toString, "implicitReceiver"));
    Assert.assertNotNull(toString.getImplicitReceiver());
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:31,代码来源:BeforeLinkingTest.java

示例6: testImplicitFirstArgument

import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
@Test
public void testImplicitFirstArgument() {
  try {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("{");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("val it = newArrayList");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("unmodifiableView");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    XExpression _parse = this._parseHelper.parse(_builder);
    final XBlockExpression block = ((XBlockExpression) _parse);
    Resource _eResource = block.eResource();
    final BatchLinkableResource resource = ((BatchLinkableResource) _eResource);
    XExpression _last = IterableExtensions.<XExpression>last(block.getExpressions());
    final XFeatureCall unmodifiableView = ((XFeatureCall) _last);
    XExpression _implicitFirstArgument = unmodifiableView.getImplicitFirstArgument();
    final XFeatureCall implicitFirstArgument = ((XFeatureCall) _implicitFirstArgument);
    Assert.assertEquals("it", implicitFirstArgument.getFeature().getSimpleName());
    resource.update(0, 0, "");
    Assert.assertNull(this._reflectExtensions.<Object>get(unmodifiableView, "implicitFirstArgument"));
    Assert.assertNotNull(unmodifiableView.getImplicitFirstArgument());
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:31,代码来源:BeforeLinkingTest.java

示例7: bindXtextResource

import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
@Override
public Class<? extends XtextResource> bindXtextResource() {
	return BatchLinkableResource.class;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:5,代码来源:DefaultXbaseRuntimeModule.java


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