本文整理汇总了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;
}
}
}
示例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);
}
}
示例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();
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例7: bindXtextResource
import org.eclipse.xtext.xbase.resource.BatchLinkableResource; //导入依赖的package包/类
@Override
public Class<? extends XtextResource> bindXtextResource() {
return BatchLinkableResource.class;
}