本文整理汇总了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;
}
示例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;
}
示例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);
}