本文整理了Java中org.eclipse.xtext.xbase.XAbstractFeatureCall.getFeature()
方法的一些代码示例,展示了XAbstractFeatureCall.getFeature()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAbstractFeatureCall.getFeature()
方法的具体详情如下:
包路径:org.eclipse.xtext.xbase.XAbstractFeatureCall
类名称:XAbstractFeatureCall
方法名:getFeature
[英]Returns the value of the 'Feature' reference.
If the meaning of the 'Feature' reference isn't clear, there really should be more of a description here...
[中]返回“Feature”引用的值。
如果“Feature”引用的含义不清楚,这里真的应该有更多的描述。。。
代码示例来源:origin: io.sarl.lang/io.sarl.lang
private static void updateReferenceList(List<XAbstractFeatureCall> references, Set<String> identifiers,
XAbstractFeatureCall featureCall) {
final JvmIdentifiableElement feature = featureCall.getFeature();
if (feature instanceof JvmFormalParameter || feature instanceof XVariableDeclaration || feature instanceof JvmField) {
if (identifiers.add(feature.getIdentifier())) {
references.add(featureCall);
}
} else if (!references.contains(featureCall)) {
references.add(featureCall);
}
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
public Boolean caseXAbstractFeatureCall(XAbstractFeatureCall object) {
JvmIdentifiableElement feature = object.getFeature();
if (feature instanceof JvmExecutable) {
accept((JvmExecutable)feature);
}
return Boolean.TRUE;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
private EObject getNonArtificialObject(EObject object) {
EObject nonArtificialObject = object;
if(object.eResource() == null && object instanceof XAbstractFeatureCall) {
nonArtificialObject = ((XAbstractFeatureCall) object).getFeature();
}
return nonArtificialObject;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
public JvmAnnotationReference findCompoundAssignmentAnnotation(XAbstractFeatureCall featureCall) {
final JvmIdentifiableElement feature = featureCall.getFeature();
return findReassignFirstArgumentAnnotation(feature);
}
代码示例来源:origin: io.sarl.lang/io.sarl.lang
private static boolean isLocalEntity(XAbstractFeatureCall featureCall, XExpression container, List<JvmFormalParameter> containerParameters) {
final JvmIdentifiableElement feature = featureCall.getFeature();
if (feature instanceof JvmFormalParameter) {
if (containerParameters.contains(feature)) {
return true;
}
} else if (feature instanceof XVariableDeclaration) {
if (EcoreUtil.isAncestor(container, feature)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
public void acceptStaticImport(final XAbstractFeatureCall statImport) {
this.staticImport.add(this.qualifiedNameWithout$(statImport.getFeature()));
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
public void acceptStaticExtensionImport(final XAbstractFeatureCall extImport) {
this.extensions.add(this.qualifiedNameWithout$(extImport.getFeature()));
}
代码示例来源:origin: io.sarl.lang/io.sarl.lang
@Override
protected void collectExits(EObject expr, List<XExpression> found) {
super.collectExits(expr, found);
if (expr instanceof XAbstractFeatureCall) {
final JvmIdentifiableElement element = ((XAbstractFeatureCall) expr).getFeature();
if (this.earlyExitComputer.isEarlyExitAnnotatedElement(element)) {
found.add((XExpression) expr);
}
}
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase.ide
protected boolean isExtensionWithImplicitFirstArgument(XAbstractFeatureCall featureCall) {
XExpression implicitReceiver = featureCall.getImplicitReceiver();
return implicitReceiver instanceof XAbstractFeatureCall
&& isExtension(((XAbstractFeatureCall) implicitReceiver).getFeature());
}
代码示例来源:origin: org.eclipse.xtend/org.eclipse.xtend.core
protected void addReferenceToTypeFromStaticImport(final XAbstractFeatureCall sourceCandidate, final Predicate<URI> targetURISet, final IReferenceFinder.Acceptor acceptor) {
final JvmIdentifiableElement feature = sourceCandidate.getFeature();
if ((feature instanceof JvmMember)) {
final JvmDeclaredType type = ((JvmMember)feature).getDeclaringType();
this.addReferenceIfTarget(type, targetURISet, sourceCandidate, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, acceptor);
}
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Check
public void checkReferInvalidTypes(XAbstractFeatureCall featureCall) {
checkReferInvalidTypes(
featureCall.getFeature(),
featureCall,
XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE);
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
protected InvokedResolvedOperation resolve(XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes, ITypeReferenceOwner owner) {
JvmIdentifiableElement feature = featureCall.getFeature();
if (feature instanceof JvmOperation) {
LightweightTypeReference contextType = getReceiverType(featureCall, resolvedTypes, owner);
return new InvokedResolvedOperation((JvmOperation) feature, contextType, resolvedTypes.getActualTypeArguments(featureCall), overrideTester);
} else {
throw new IllegalArgumentException();
}
}
代码示例来源:origin: io.sarl.lang/io.sarl.lang
@Override
protected Collection<ExitPoint> _exitPoints(XAbstractFeatureCall expression) {
final Collection<ExitPoint> exitPoints = super._exitPoints(expression);
if (isNotEmpty(exitPoints)) {
return exitPoints;
}
final JvmIdentifiableElement element = expression.getFeature();
if (isEarlyExitAnnotatedElement(element)) {
return Collections.<ExitPoint>singletonList(new SarlExitPoint(expression, false));
}
return Collections.emptyList();
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Check
public void checkDeprecated(XAbstractFeatureCall expression) {
if (!isIgnored(DEPRECATED_MEMBER_REFERENCE)) {
JvmIdentifiableElement feature = expression.getFeature();
checkDeprecated(
feature,
expression,
XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE);
}
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
private void collectStaticImportsFrom(final XAbstractFeatureCall featureCall, IAmbiguousLinkingCandidate optionalAmbiguousCandidate) {
if (optionalAmbiguousCandidate != null) {
for (ILinkingCandidate linkingCandidate : optionalAmbiguousCandidate.getAlternatives()) {
collectStaticImportsFrom(linkingCandidate);
}
} else {
collectStaticImportsFrom(featureCall, featureCall.getFeature());
}
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
protected Object evaluateGetAndAssign(XAbstractFeatureCall featureCall, IEvaluationContext context, CancelIndicator indicator) {
XAbstractFeatureCall operand = (XAbstractFeatureCall) featureCall.getActualArguments().get(0);
Object originalValue = internalEvaluate(operand, context, indicator);
Object value = applyGetAndAssignOperator(originalValue, featureCall.getConcreteSyntaxFeatureName());
assignValueTo(operand.getFeature(), featureCall, value, context, indicator);
return originalValue;
}
代码示例来源:origin: io.sarl.lang/io.sarl.lang
private void buildLeftOperand(XAbstractFeatureCall expr, List<Object> output) {
final XBinaryOperation binaryOperation = (XBinaryOperation) expr;
final XAbstractFeatureCall leftOperand = (XAbstractFeatureCall) binaryOperation.getLeftOperand();
final JvmIdentifiableElement feature = leftOperand.getFeature();
if (this.codeReceiver.hasName(feature)) {
output.add(this.codeReceiver.getName(feature));
return;
}
buildCallReceiver(leftOperand, getExtraLanguageKeywordProvider().getThisKeywordLambda(),
this.referenceNameLambda, output);
output.add(feature.getSimpleName());
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
protected LightweightTypeReference getReceiverType(XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes, ITypeReferenceOwner owner) {
XExpression receiver = featureCall.getActualReceiver();
if (receiver == null) {
// static feature call
JvmOperation operation = (JvmOperation) featureCall.getFeature();
JvmDeclaredType declaringType = operation.getDeclaringType();
return owner.newParameterizedTypeReference(declaringType);
}
return resolvedTypes.getActualType(receiver);
}
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
protected ITreeAppendable appendLeftOperand(final XAbstractFeatureCall expr, ITreeAppendable appendable, boolean isExpressionContext) {
XBinaryOperation binaryOperation = (XBinaryOperation) expr;
XAbstractFeatureCall leftOperand = (XAbstractFeatureCall) binaryOperation.getLeftOperand();
JvmIdentifiableElement feature = leftOperand.getFeature();
if (appendable.hasName(feature)) {
return appendable.append(appendable.getName(feature));
}
boolean hasReceiver = appendReceiver(leftOperand, appendable, isExpressionContext);
if (hasReceiver) {
appendable.append(".");
}
return appendable.append(feature.getSimpleName());
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
public void applyToComputationState() {
ResolvedTypes resolvedTypes = getState().getResolvedTypes();
LightweightTypeReference actualType = resolvedTypes.getActualType(getFeature());
if (actualType == null)
throw new IllegalStateException("Cannot determine actual type of already resolved implicit receiver");
LightweightTypeReference expectedReceiverType = new FeatureLinkHelper().getExpectedReceiverType(getOwner().getFeature(), actualType);
if (expectedReceiverType != null)
expectedReceiverType = expectedReceiverType.copyInto(resolvedTypes.getReferenceOwner());
TypeExpectation expectation = new TypeExpectation(expectedReceiverType, getState(), false);
resolvedTypes.acceptType(getFeatureCall(), expectation, actualType.copyInto(resolvedTypes.getReferenceOwner()), false, ConformanceFlags.UNCHECKED);
super.applyToComputationState();
}
内容来源于网络,如有侵权,请联系作者删除!