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