本文整理汇总了Java中org.eclipse.xtext.xbase.XExpression.eClass方法的典型用法代码示例。如果您正苦于以下问题:Java XExpression.eClass方法的具体用法?Java XExpression.eClass怎么用?Java XExpression.eClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.XExpression
的用法示例。
在下文中一共展示了XExpression.eClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isImplicitReturn
import org.eclipse.xtext.xbase.XExpression; //导入方法依赖的package包/类
protected boolean isImplicitReturn(ITypeComputationResult expressionResult) {
int flags = expressionResult.getConformanceFlags();
if ((ConformanceFlags.NO_IMPLICIT_RETURN & flags) != 0) {
return false;
}
XExpression expression = expressionResult.getExpression();
if (expression == null) {
return true;
}
if (expression.eClass() == XbasePackage.Literals.XRETURN_EXPRESSION) {
return false;
}
TreeIterator<EObject> contents = expression.eAllContents();
while (contents.hasNext()) {
EObject next = contents.next();
if (next.eClass() == XbasePackage.Literals.XRETURN_EXPRESSION) {
return false;
}
if (next.eClass() == XbasePackage.Literals.XCLOSURE) {
contents.prune();
}
}
return true;
}
示例2: markConstantBooleanCondition
import org.eclipse.xtext.xbase.XExpression; //导入方法依赖的package包/类
protected void markConstantBooleanCondition(XExpression predicate, BooleanResult booleanResult, boolean ignoreBooleanLiteral) {
if (!ignoreBooleanLiteral || predicate.eClass() != XbasePackage.Literals.XBOOLEAN_LITERAL) {
Optional<Boolean> value = booleanResult.getValue();
if (value.isPresent()) {
addIssue("Constant condition is always " + value.get() + ".", predicate, null, IssueCodes.CONSTANT_BOOLEAN_CONDITION);
} else {
addIssue("Constant condition.", predicate, null, IssueCodes.CONSTANT_BOOLEAN_CONDITION);
}
}
}
示例3: doGetLinkedFeature
import org.eclipse.xtext.xbase.XExpression; //导入方法依赖的package包/类
protected JvmIdentifiableElement doGetLinkedFeature(/* @Nullable */ XExpression featureOrConstructorCall) {
if (linkingMap == null || featureOrConstructorCall == null || featureOrConstructorCall.eClass() == XbasePackage.Literals.XCLOSURE)
return null;
IApplicableCandidate candidate = linkingMap.get(featureOrConstructorCall);
if (candidate == null)
return null;
return ((ILinkingCandidate) candidate).getFeature();
}
示例4: doGetActualTypeArguments
import org.eclipse.xtext.xbase.XExpression; //导入方法依赖的package包/类
protected List<LightweightTypeReference> doGetActualTypeArguments(XExpression expression) {
if (expression == null || expression.eClass() == XbasePackage.Literals.XCLOSURE) {
return Collections.emptyList();
}
ILinkingCandidate result = (ILinkingCandidate) basicGetLinkingMap().get(expression);
if (result != null) {
return result.getTypeArguments();
}
return Collections.emptyList();
}