本文整理了Java中org.eclipse.xtext.xbase.XAbstractFeatureCall.eResource()
方法的一些代码示例,展示了XAbstractFeatureCall.eResource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAbstractFeatureCall.eResource()
方法的具体详情如下:
包路径:org.eclipse.xtext.xbase.XAbstractFeatureCall
类名称:XAbstractFeatureCall
方法名:eResource
暂无
代码示例来源:origin: io.sarl.lang/io.sarl.lang
/** Get the string representation of an operator.
*
* @param call the call to the operator feature.
* @return the string representation of the operator or {@code null} if not a valid operator.
*/
protected String getOperatorSymbol(XAbstractFeatureCall call) {
if (call != null) {
final Resource res = call.eResource();
if (res instanceof StorageAwareResource) {
final boolean isLoadedFromStorage = ((StorageAwareResource) res).isLoadedFromStorage();
if (isLoadedFromStorage) {
final QualifiedName operator = getOperatorMapping().getOperator(
QualifiedName.create(call.getFeature().getSimpleName()));
return Objects.toString(operator);
}
}
return call.getConcreteSyntaxFeatureName();
}
return null;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
protected String getOperator(final XAbstractFeatureCall call) {
String _switchResult = null;
Resource _eResource = call.eResource();
final Resource res = _eResource;
boolean _matched = false;
if (res instanceof StorageAwareResource) {
boolean _isLoadedFromStorage = ((StorageAwareResource)res).isLoadedFromStorage();
if (_isLoadedFromStorage) {
_matched=true;
QualifiedName _operator = this.operatorMapping.getOperator(QualifiedName.create(call.getFeature().getSimpleName()));
String _string = null;
if (_operator!=null) {
_string=_operator.toString();
}
return _string;
}
}
if (!_matched) {
_switchResult = call.getConcreteSyntaxFeatureName();
}
return _switchResult;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
protected IFeatureLinkingCandidate getKnownFeature(XAbstractFeatureCall featureCall, AbstractTypeComputationState state, ResolvedTypes resolvedTypes) {
IFeatureLinkingCandidate result = resolvedTypes.getFeature(featureCall);
if (result != null) {
return new AppliedFeatureLinkingCandidate(result);
}
EObject proxyOrResolved = (EObject) featureCall.eGet(XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, false);
if (proxyOrResolved == null) {
return new NullFeatureLinkingCandidate(featureCall, state);
}
if (!proxyOrResolved.eIsProxy()) {
return state.createResolvedLink(featureCall, (JvmIdentifiableElement) proxyOrResolved);
}
if (!encoder.isCrossLinkFragment(featureCall.eResource(), EcoreUtil.getURI(proxyOrResolved).fragment())) {
JvmIdentifiableElement feature = featureCall.getFeature();
if (!feature.eIsProxy()) {
return state.createResolvedLink(featureCall, feature);
}
}
return null;
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase
@Override
protected CandidateCompareResult getExpectedTypeCompareResultOther(AbstractPendingLinkingCandidate<?> right) {
if (!(right instanceof FeatureLinkingCandidate) || getState().isIgnored(IssueCodes.SUSPICIOUSLY_OVERLOADED_FEATURE))
return CandidateCompareResult.OTHER;
FeatureLinkingCandidate casted = (FeatureLinkingCandidate) right;
XExpression otherImplicitReceiver = casted.getImplicitReceiver();
if (otherImplicitReceiver != null) {
if (isStatic() == casted.isStatic()) {
if (otherImplicitReceiver instanceof XAbstractFeatureCall && getImplicitReceiver() instanceof XAbstractFeatureCall) {
JvmIdentifiableElement otherImplicitReceiverFeature = ((XAbstractFeatureCall) otherImplicitReceiver).getFeature();
if (otherImplicitReceiverFeature != ((XAbstractFeatureCall) getImplicitReceiver()).getFeature())
return CandidateCompareResult.SUSPICIOUS_OTHER;
}
}
} else {
if (isStatic() && casted.isStatic()) {
JvmIdentifiableElement otherFeature = casted.getFeature();
if (getFeature().eContainer() != otherFeature.eContainer() && otherFeature.eResource() == getExpression().eResource()) {
if (EcoreUtil.isAncestor(otherFeature.eContainer(), getFeature())) {
return CandidateCompareResult.SUSPICIOUS_OTHER;
}
}
}
}
return CandidateCompareResult.OTHER;
}
内容来源于网络,如有侵权,请联系作者删除!