本文整理汇总了Java中org.eclipse.xtext.xbase.XFeatureCall.setFeature方法的典型用法代码示例。如果您正苦于以下问题:Java XFeatureCall.setFeature方法的具体用法?Java XFeatureCall.setFeature怎么用?Java XFeatureCall.setFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.XFeatureCall
的用法示例。
在下文中一共展示了XFeatureCall.setFeature方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addExtensionsToCurrentScope
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
@Override
public void addExtensionsToCurrentScope(List<? extends JvmIdentifiableElement> extensionProviders) {
if (extensionProviders.isEmpty())
return;
if (extensionProviders.size() == 1) {
addExtensionToCurrentScope(extensionProviders.get(0));
return;
}
Map<XExpression, LightweightTypeReference> prototypeToType = Maps2.newLinkedHashMapWithExpectedSize(extensionProviders.size());
for(JvmIdentifiableElement extensionProvider: extensionProviders) {
LightweightTypeReference knownType = getResolvedTypes().getActualType(extensionProvider);
if (knownType != null && !knownType.isAny() && !knownType.isUnknown()) {
XFeatureCall prototype = getResolver().getXbaseFactory().createXFeatureCall();
prototype.setFeature(extensionProvider);
prototypeToType.put(prototype, knownType);
}
}
if (!prototypeToType.isEmpty())
featureScopeSession = featureScopeSession.addToExtensionScope(prototypeToType);
}
示例2: createImplicitFeatureCallScope
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
protected IScope createImplicitFeatureCallScope(QualifiedName implicitName, EObject featureCall,
IFeatureScopeSession session, IResolvedTypes resolvedTypes, IScope parent) {
IEObjectDescription thisDescription = session.getLocalElement(implicitName);
if (thisDescription != null) {
JvmIdentifiableElement thisElement = (JvmIdentifiableElement) thisDescription.getEObjectOrProxy();
boolean validStaticScope = true;
if (thisElement instanceof JvmType && THIS.equals(implicitName) && !session.isInstanceContext()) {
validStaticScope = false;
}
LightweightTypeReference type = resolvedTypes.getActualType(thisElement);
if (type !=null && !type.isUnknown()) {
XFeatureCall implicitReceiver = xbaseFactory.createXFeatureCall();
implicitReceiver.setFeature(thisElement);
return createFeatureScopeForTypeRef(implicitReceiver, type, true, featureCall, session, thisElement, parent, validStaticScope);
}
}
return parent;
}
示例3: addExtensionToCurrentScope
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
@Override
public void addExtensionToCurrentScope(JvmIdentifiableElement extensionProvider) {
LightweightTypeReference knownType = getResolvedTypes().getActualType(extensionProvider);
if (knownType != null && !knownType.isAny() && !knownType.isUnknown()) {
XFeatureCall prototype = getResolver().getXbaseFactory().createXFeatureCall();
prototype.setFeature(extensionProvider);
featureScopeSession = featureScopeSession.addToExtensionScope(Collections.<XExpression, LightweightTypeReference>singletonMap(prototype, knownType));
}
}
示例4: addExtensionsToMemberSession
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
protected IFeatureScopeSession addExtensionsToMemberSession(ResolvedTypes resolvedTypes,
IFeatureScopeSession featureScopeSession, JvmDeclaredType type) {
IEObjectDescription thisDescription = featureScopeSession.getLocalElement(IFeatureNames.THIS);
if (thisDescription == null) {
throw new IllegalStateException("Cannot find feature 'THIS'");
}
JvmIdentifiableElement thisFeature = (JvmIdentifiableElement) thisDescription.getEObjectOrProxy();
IFeatureScopeSession childSession = addExtensionFieldsToMemberSession(
resolvedTypes, featureScopeSession, type, thisFeature, Sets.<String>newHashSetWithExpectedSize(8), Sets.<JvmType>newHashSetWithExpectedSize(4));
XFeatureCall thisAccess = getXbaseFactory().createXFeatureCall();
thisAccess.setFeature(thisFeature);
LightweightTypeReference thisType = resolvedTypes.getActualType(thisFeature);
childSession = childSession.addToExtensionScope(Collections.<XExpression, LightweightTypeReference>singletonMap(thisAccess, thisType));
return childSession;
}
示例5: createDynamicExtensionsScope
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
protected IScope createDynamicExtensionsScope(QualifiedName implicitFirstArgumentName, IEObjectDescription firstArgumentDescription, EObject featureCall,
IFeatureScopeSession captureLayer, IFeatureScopeSession session, IResolvedTypes resolvedTypes, IScope parent) {
JvmIdentifiableElement feature = (JvmIdentifiableElement) firstArgumentDescription.getEObjectOrProxy();
if (feature instanceof JvmType && THIS.equals(implicitFirstArgumentName) && !session.isInstanceContext()) {
return parent;
}
LightweightTypeReference type = resolvedTypes.getActualType(feature);
if (type != null && !type.isUnknown()) {
XFeatureCall implicitArgument = xbaseFactory.createXFeatureCall();
implicitArgument.setFeature(feature);
return createDynamicExtensionsScope(featureCall, implicitArgument, type, true, parent, captureLayer);
}
return parent;
}
示例6: createImplicitExtensionScope
import org.eclipse.xtext.xbase.XFeatureCall; //导入方法依赖的package包/类
protected IScope createImplicitExtensionScope(QualifiedName implicitName, EObject featureCall,
IFeatureScopeSession session, IResolvedTypes resolvedTypes, IScope parent) {
IEObjectDescription thisDescription = session.getLocalElement(implicitName);
if (thisDescription != null) {
JvmIdentifiableElement thisElement = (JvmIdentifiableElement) thisDescription.getEObjectOrProxy();
LightweightTypeReference type = resolvedTypes.getActualType(thisElement);
if (type != null && !type.isUnknown()) {
XFeatureCall implicitReceiver = xbaseFactory.createXFeatureCall();
implicitReceiver.setFeature(thisElement);
return createStaticExtensionsScope(featureCall, implicitReceiver, type, true, parent, session);
}
}
return parent;
}