Class PlatformSimpleScope

  • All Implemented Interfaces:
    ISlicedScope, org.eclipse.xtext.scoping.IScope

    public class PlatformSimpleScope
    extends CachedLightSimpleScope
    SimpleScope with ignoring case.
    This scope is used for different platform elements in DT projects.
    Also this scope caches elements by their name. So method getSingleElement(QualifiedName) doesn't look over by all description for finding element by its name
    • Constructor Detail

      • PlatformSimpleScope

        public PlatformSimpleScope​(org.eclipse.xtext.scoping.IScope parent,
                                   Iterable<org.eclipse.xtext.resource.IEObjectDescription> descriptions,
                                   boolean ignoreCase,
                                   Collection<ISliceFilter> predicatesForSlices)
        Constructor
        Parameters:
        parent - parent scope, can't be null
        descriptions - all elements contained in scope, can't be null
        ignoreCase - whether name lookup and shadowing should be case insensitive or not.
        predicatesForSlices - collection of Predicate defining slices of index elements, can't be null
      • PlatformSimpleScope

        public PlatformSimpleScope​(Iterable<org.eclipse.xtext.resource.IEObjectDescription> descriptions,
                                   boolean ignoreCase,
                                   Collection<ISliceFilter> predicatesForSlices)
        Constructor
        Parameters:
        descriptions - all elements contained in scope, can't be null
        ignoreCase - whether name lookup and shadowing should be case insensitive or not.
        predicatesForSlices - collection of Predicate defining slices of index elements, can't be null
    • Method Detail

      • getSingleElement

        public org.eclipse.xtext.resource.IEObjectDescription getSingleElement​(org.eclipse.xtext.naming.QualifiedName name)
        Specified by:
        getSingleElement in interface org.eclipse.xtext.scoping.IScope
        Overrides:
        getSingleElement in class CachedLightSimpleScope
      • getElements

        public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements​(org.eclipse.xtext.naming.QualifiedName name)
        Specified by:
        getElements in interface org.eclipse.xtext.scoping.IScope
        Overrides:
        getElements in class CachedLightSimpleScope
      • getSingleElement

        public org.eclipse.xtext.resource.IEObjectDescription getSingleElement​(org.eclipse.emf.ecore.EObject object)
        Specified by:
        getSingleElement in interface org.eclipse.xtext.scoping.IScope
        Overrides:
        getSingleElement in class LightAbstractScope
      • getElements

        public Iterable<org.eclipse.xtext.resource.IEObjectDescription> getElements​(org.eclipse.emf.ecore.EObject object)
        Specified by:
        getElements in interface org.eclipse.xtext.scoping.IScope
        Overrides:
        getElements in class LightAbstractScope
      • isShadowed

        protected boolean isShadowed​(org.eclipse.xtext.resource.IEObjectDescription element)
        Description copied from class: LightAbstractScope
        Returns true if the given description input from the parent scope is shadowed by local elements.
        Overrides:
        isShadowed in class CachedLightSimpleScope
        Returns:
        true if the given description input from the parent scope is shadowed by local elements.