Class Scopes


  • public class Scopes
    extends java.lang.Object
    This class contains static utility functions to create and work on IScope and IEObjectDescription
    • Constructor Summary

      Constructors 
      Constructor Description
      Scopes()  
    • Constructor Detail

      • Scopes

        public Scopes()
    • Method Detail

      • scopeFor

        public static IScope scopeFor​(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements)
        creates a scope using SimpleAttributeResolver.NAME_RESOLVER to compute the names and sets IScope.NULLSCOPE as parent scope
      • scopeFor

        public static IScope scopeFor​(java.lang.Iterable<? extends org.eclipse.emf.ecore.EObject> elements,
                                      IScope outer)
        creates a scope using SimpleAttributeResolver.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 an Iterable of EObjects into an Iterable of IEObjectDescriptions computing the EAttribute 'name' to compute the IEObjectDescription'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 an Iterable of EObjects into an Iterable of IEObjectDescriptions computing the name of the elements using the passed Function If the passed function returns null the object is filtered out.