本文整理汇总了Java中org.eclipse.xtext.common.types.JvmFormalParameter.eContainingFeature方法的典型用法代码示例。如果您正苦于以下问题:Java JvmFormalParameter.eContainingFeature方法的具体用法?Java JvmFormalParameter.eContainingFeature怎么用?Java JvmFormalParameter.eContainingFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.common.types.JvmFormalParameter
的用法示例。
在下文中一共展示了JvmFormalParameter.eContainingFeature方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: highlightFormalParameter
import org.eclipse.xtext.common.types.JvmFormalParameter; //导入方法依赖的package包/类
protected void highlightFormalParameter(JvmFormalParameter parameterDecl, IHighlightedPositionAcceptor acceptor) {
if (!SPECIAL_FEATURE_NAMES.contains(parameterDecl.getName())) {
// highlighting of special identifiers is done separately, so it's omitted here
if (parameterDecl.eContainingFeature() == XbasePackage.Literals.XCLOSURE__DECLARED_FORMAL_PARAMETERS) {
highlightFeature(acceptor, parameterDecl, TypesPackage.Literals.JVM_FORMAL_PARAMETER__NAME, PARAMETER_VARIABLE);
} else {
// covers parameters of for and template expr FOR loops, as well as switch statements
highlightFeature(acceptor, parameterDecl, TypesPackage.Literals.JVM_FORMAL_PARAMETER__NAME, LOCAL_VARIABLE_DECLARATION);
highlightFeature(acceptor, parameterDecl, TypesPackage.Literals.JVM_FORMAL_PARAMETER__NAME, LOCAL_FINAL_VARIABLE_DECLARATION);
}
}
}
示例2: _assertEqualLinkingData
import org.eclipse.xtext.common.types.JvmFormalParameter; //导入方法依赖的package包/类
protected void _assertEqualLinkingData(final IClosureCandidate left, final IClosureCandidate right) {
Assert.assertEquals("type", left.getParameters().size(), right.getParameters().size());
final Procedure2<JvmFormalParameter, Integer> _function = (JvmFormalParameter leftParam, Integer idx) -> {
final JvmFormalParameter rightParam = right.getParameters().get((idx).intValue());
Assert.assertEquals(leftParam.getName(), rightParam.getName());
EStructuralFeature _eContainingFeature = leftParam.eContainingFeature();
boolean _notEquals = (!Objects.equal(_eContainingFeature, XbasePackage.Literals.XCLOSURE__DECLARED_FORMAL_PARAMETERS));
if (_notEquals) {
Assert.assertEquals(leftParam.getParameterType().getIdentifier(), rightParam.getParameterType().getIdentifier());
}
};
IterableExtensions.<JvmFormalParameter>forEach(left.getParameters(), _function);
}