当前位置: 首页>>代码示例>>Java>>正文


Java XFeatureCall.setFeature方法代码示例

本文整理汇总了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);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:AbstractTypeComputationState.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:19,代码来源:FeatureScopes.java

示例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));
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:10,代码来源:AbstractTypeComputationState.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:16,代码来源:LogicalContainerAwareReentrantTypeResolver.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:15,代码来源:FeatureScopes.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:15,代码来源:FeatureScopes.java


注:本文中的org.eclipse.xtext.xbase.XFeatureCall.setFeature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。