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


Java IResourceDescriptions.getExportedObjects方法代码示例

本文整理汇总了Java中org.eclipse.xtext.resource.IResourceDescriptions.getExportedObjects方法的典型用法代码示例。如果您正苦于以下问题:Java IResourceDescriptions.getExportedObjects方法的具体用法?Java IResourceDescriptions.getExportedObjects怎么用?Java IResourceDescriptions.getExportedObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.resource.IResourceDescriptions的用法示例。


在下文中一共展示了IResourceDescriptions.getExportedObjects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIndexedJvmType

import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
public EObject getIndexedJvmType(QualifiedName qualifiedName, String fragment, ResourceSet resourceSet, boolean throwShadowedException) throws UnknownNestedTypeException {
	if (resourceSet != null) {
		IResourceDescriptions descriptions = resourceDescriptionsProvider.getResourceDescriptions(resourceSet);
		Iterable<IEObjectDescription> candidates = descriptions.getExportedObjects(TypesPackage.Literals.JVM_TYPE, qualifiedName, false);
		Iterator<IEObjectDescription> iterator = candidates.iterator();
		if (iterator.hasNext()) {
			EObject result = findAccessibleType(fragment, resourceSet, iterator);
			if (result != null) {
				return result;
			}
		}
		if (throwShadowedException && descriptions instanceof IShadowedResourceDescriptions) {
			if (((IShadowedResourceDescriptions) descriptions).isShadowed(TypesPackage.Literals.JVM_TYPE, qualifiedName, false)) {
				throw new ShadowedTypeException("The type '"+qualifiedName+"' is locally shadowed.");
			}
		}
	}
	return null;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:20,代码来源:IndexedJvmTypeAccess.java

示例2: findPackageInAllDescriptions

import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
private EPackage findPackageInAllDescriptions(EObject context, QualifiedName packageNsURI) {
	IResourceDescriptions descriptions = descriptionsProvider.getResourceDescriptions(context.eResource());
	if (descriptions != null) {
		Iterable<IEObjectDescription> exported = descriptions.getExportedObjects(EcorePackage.Literals.EPACKAGE, packageNsURI, false);
		for(IEObjectDescription candidate: exported) {
			if (isNsUriIndexEntry(candidate)) {
				EPackage result = getResolvedEPackage(candidate, context);
				if (result != null)
					return result;
			}
		}
	}
	return null;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:15,代码来源:XtextLinkingService.java

示例3: doCheckUniqueName

import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
protected boolean doCheckUniqueName(final QualifiedName name, final JvmDeclaredType type) {
  final IResourceDescriptions index = this.resourceDescriptionsProvider.getResourceDescriptions(type.eResource());
  final Iterable<IEObjectDescription> others = index.getExportedObjects(TypesPackage.Literals.JVM_DECLARED_TYPE, name, false);
  return this.checkUniqueInIndex(type, others);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:6,代码来源:UniqueClassNameValidator.java


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