本文整理汇总了Java中org.eclipse.xtext.xbase.XFeatureCall.eResource方法的典型用法代码示例。如果您正苦于以下问题:Java XFeatureCall.eResource方法的具体用法?Java XFeatureCall.eResource怎么用?Java XFeatureCall.eResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.XFeatureCall
的用法示例。
在下文中一共展示了XFeatureCall.eResource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLinkToParameter_1
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
@Test
public void testLinkToParameter_1() {
try {
XExpression _expression = this.expression("x", false);
final XFeatureCall expr = ((XFeatureCall) _expression);
final Resource resource = expr.eResource();
resource.eSetDeliver(false);
EList<EObject> _contents = resource.getContents();
final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> {
EList<JvmMember> _members = it.getMembers();
JvmField _field = this._jvmTypesBuilder.toField(expr, "x", this.stringType(expr));
this._jvmTypesBuilder.<JvmField>operator_add(_members, _field);
EList<JvmMember> _members_1 = it.getMembers();
final Procedure1<JvmOperation> _function_1 = (JvmOperation it_1) -> {
EList<JvmFormalParameter> _parameters = it_1.getParameters();
JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(expr, "x", this.stringType(expr));
this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter);
this._jvmTypesBuilder.setBody(it_1, expr);
};
JvmOperation _method = this._jvmTypesBuilder.toMethod(expr, "doStuff", this.stringType(expr), _function_1);
this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _method);
};
JvmGenericType _class = this._jvmTypesBuilder.toClass(expr, "Foo", _function);
this._jvmTypesBuilder.<JvmGenericType>operator_add(_contents, _class);
this._validationTestHelper.assertNoErrors(expr);
JvmIdentifiableElement _feature = expr.getFeature();
Assert.assertTrue((_feature instanceof JvmFormalParameter));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例2: testLinkToField
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
@Test
public void testLinkToField() {
try {
XExpression _expression = this.expression("x", false);
final XFeatureCall expr = ((XFeatureCall) _expression);
final Resource resource = expr.eResource();
resource.eSetDeliver(false);
EList<EObject> _contents = resource.getContents();
final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> {
EList<JvmMember> _members = it.getMembers();
JvmField _field = this._jvmTypesBuilder.toField(expr, "x", this.stringType(expr));
this._jvmTypesBuilder.<JvmField>operator_add(_members, _field);
EList<JvmMember> _members_1 = it.getMembers();
final Procedure1<JvmOperation> _function_1 = (JvmOperation it_1) -> {
EList<JvmFormalParameter> _parameters = it_1.getParameters();
JvmFormalParameter _parameter = this._jvmTypesBuilder.toParameter(expr, "y", this.stringType(expr));
this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter);
this._jvmTypesBuilder.setBody(it_1, expr);
};
JvmOperation _method = this._jvmTypesBuilder.toMethod(expr, "doStuff", this.stringType(expr), _function_1);
this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _method);
};
JvmGenericType _class = this._jvmTypesBuilder.toClass(expr, "Foo", _function);
this._jvmTypesBuilder.<JvmGenericType>operator_add(_contents, _class);
this._validationTestHelper.assertNoErrors(expr);
JvmIdentifiableElement _feature = expr.getFeature();
Assert.assertTrue((_feature instanceof JvmField));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例3: testLinkToField_1
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
@Test
public void testLinkToField_1() {
try {
XExpression _expression = this.expression("x", false);
final XFeatureCall expr = ((XFeatureCall) _expression);
final Resource resource = expr.eResource();
resource.eSetDeliver(false);
EList<EObject> _contents = resource.getContents();
final Procedure1<JvmGenericType> _function = (JvmGenericType it) -> {
EList<JvmMember> _members = it.getMembers();
JvmField _field = this._jvmTypesBuilder.toField(expr, "x", this.stringType(expr));
this._jvmTypesBuilder.<JvmField>operator_add(_members, _field);
EList<JvmMember> _members_1 = it.getMembers();
final Procedure1<JvmOperation> _function_1 = (JvmOperation it_1) -> {
this._jvmTypesBuilder.setBody(it_1, expr);
};
JvmOperation _method = this._jvmTypesBuilder.toMethod(expr, "getX", this.stringType(expr), _function_1);
this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _method);
};
JvmGenericType _class = this._jvmTypesBuilder.toClass(expr, "Foo", _function);
this._jvmTypesBuilder.<JvmGenericType>operator_add(_contents, _class);
this._validationTestHelper.assertNoErrors(expr);
JvmIdentifiableElement _feature = expr.getFeature();
Assert.assertTrue((_feature instanceof JvmField));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}