Package org.eclipse.xtext.scoping
Class Scopes
- java.lang.Object
-
- org.eclipse.xtext.scoping.Scopes
-
public class Scopes extends java.lang.Object
This class contains static utility functions to create and work onIScope
andIEObjectDescription
-
-
Constructor Summary
Constructors Constructor Description Scopes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Iterable<IEObjectDescription>
filterDuplicates(java.lang.Iterable<IEObjectDescription> filtered)
static com.google.common.collect.Multimap<QualifiedName,IEObjectDescription>
index(java.lang.Iterable<IEObjectDescription> descriptions)
indexes the IEObject description using the givenstatic <T> com.google.common.collect.Multimap<T,IEObjectDescription>
index(java.lang.Iterable<IEObjectDescription> descriptions, com.google.common.base.Function<IEObjectDescription,T> indexer)
indexes the IEObject description using the givenstatic java.lang.Iterable<IEObjectDescription>
scopedElementsFor(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
transforms anIterable
ofEObject
s into anIterable
ofIEObjectDescription
s computing theEAttribute
'name' to compute theIEObjectDescription
's name.static <T extends org.eclipse.emf.ecore.EObject>
java.lang.Iterable<IEObjectDescription>scopedElementsFor(java.lang.Iterable<? extends T> elements, com.google.common.base.Function<T,QualifiedName> nameComputation)
transforms anIterable
ofEObject
s into anIterable
ofIEObjectDescription
s computing the name of the elements using the passedFunction
If the passed function returns null the object is filtered out.static IScope
scopeFor(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
creates a scope usingSimpleAttributeResolver.NAME_RESOLVER
to compute the names and setsIScope.NULLSCOPE
as parent scopestatic IScope
scopeFor(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements, IScope outer)
creates a scope usingSimpleAttributeResolver.NAME_RESOLVER
to compute the namesstatic <T extends org.eclipse.emf.ecore.EObject>
IScopescopeFor(java.lang.Iterable<? extends T> elements, com.google.common.base.Function<T,QualifiedName> nameComputation, IScope outer)
creates a scope using the passed function to compute the names and sets the passed scope as the parent scopestatic java.lang.Iterable<IEObjectDescription>
selectCompatible(java.lang.Iterable<IEObjectDescription> exportedObjects, org.eclipse.emf.ecore.EClass clazz)
-
-
-
Method Detail
-
selectCompatible
public static java.lang.Iterable<IEObjectDescription> selectCompatible(java.lang.Iterable<IEObjectDescription> exportedObjects, org.eclipse.emf.ecore.EClass clazz)
-
scopeFor
public static IScope scopeFor(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
creates a scope usingSimpleAttributeResolver.NAME_RESOLVER
to compute the names and setsIScope.NULLSCOPE
as parent scope
-
scopeFor
public static IScope scopeFor(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements, IScope outer)
creates a scope usingSimpleAttributeResolver.NAME_RESOLVER
to compute the names
-
scopeFor
public static <T extends org.eclipse.emf.ecore.EObject> IScope scopeFor(java.lang.Iterable<? extends T> elements, com.google.common.base.Function<T,QualifiedName> nameComputation, IScope outer)
creates a scope using the passed function to compute the names and sets the passed scope as the parent scope
-
scopedElementsFor
public static java.lang.Iterable<IEObjectDescription> scopedElementsFor(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
transforms anIterable
ofEObject
s into anIterable
ofIEObjectDescription
s computing theEAttribute
'name' to compute theIEObjectDescription
's name. If not existent the object is filtered out.
-
scopedElementsFor
public static <T extends org.eclipse.emf.ecore.EObject> java.lang.Iterable<IEObjectDescription> scopedElementsFor(java.lang.Iterable<? extends T> elements, com.google.common.base.Function<T,QualifiedName> nameComputation)
transforms anIterable
ofEObject
s into anIterable
ofIEObjectDescription
s computing the name of the elements using the passedFunction
If the passed function returns null the object is filtered out.
-
index
public static <T> com.google.common.collect.Multimap<T,IEObjectDescription> index(java.lang.Iterable<IEObjectDescription> descriptions, com.google.common.base.Function<IEObjectDescription,T> indexer)
indexes the IEObject description using the given
-
index
public static com.google.common.collect.Multimap<QualifiedName,IEObjectDescription> index(java.lang.Iterable<IEObjectDescription> descriptions)
indexes the IEObject description using the given
-
filterDuplicates
public static java.lang.Iterable<IEObjectDescription> filterDuplicates(java.lang.Iterable<IEObjectDescription> filtered)
-
-