org.eclipse.xtext.common.types.xtext
Class AbstractTypeScope

java.lang.Object
  extended by org.eclipse.xtext.scoping.impl.AbstractScope
      extended by org.eclipse.xtext.common.types.xtext.AbstractTypeScope
All Implemented Interfaces:
IScope
Direct Known Subclasses:
ClasspathBasedTypeScope, JdtBasedSimpleTypeScope

public abstract class AbstractTypeScope
extends AbstractScope

A scope that provides access to types. Case insensitivity is not supported. It's always the most outer scope.

Author:
Sebastian Zarnekow - Initial contribution and API, Jan Koehnlein - introduced QualifiedName

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
AbstractScope.ParentIterable
 
Field Summary
 
Fields inherited from interface org.eclipse.xtext.scoping.IScope
NULLSCOPE
 
Constructor Summary
protected AbstractTypeScope(IJvmTypeProvider typeProvider, IQualifiedNameConverter qualifiedNameConverter, com.google.common.base.Predicate<IEObjectDescription> filter)
           
 
Method Summary
protected  java.lang.Iterable<IEObjectDescription> filterResult(java.lang.Iterable<IEObjectDescription> unfiltered)
           
 java.lang.Iterable<IEObjectDescription> getAllElements()
          Obtain all elements from the scope.
protected  java.lang.Iterable<IEObjectDescription> getAllLocalElements()
           
 java.lang.Iterable<IEObjectDescription> getElements(org.eclipse.emf.ecore.EObject object)
          Find all descriptions that match the given instance.
 java.lang.Iterable<IEObjectDescription> getElements(QualifiedName name)
          Find all descriptions that match the given name.
 IQualifiedNameConverter getQualifiedNameConverter()
           
 IEObjectDescription getSingleElement(QualifiedName name)
          Find the first description that matches the given name.
 IJvmTypeProvider getTypeProvider()
           
protected  java.lang.Iterable<IEObjectDescription> internalGetAllElements()
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.xtext.scoping.impl.AbstractScope
getLocalElementsByEObject, getLocalElementsByName, getParent, getParentElements, getSingleElement, getSingleLocalElementByName, isIgnoreCase, isShadowed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTypeScope

protected AbstractTypeScope(IJvmTypeProvider typeProvider,
                            IQualifiedNameConverter qualifiedNameConverter,
                            com.google.common.base.Predicate<IEObjectDescription> filter)
Method Detail

getSingleElement

public IEObjectDescription getSingleElement(QualifiedName name)
Description copied from interface: IScope
Find the first description that matches the given name.

Specified by:
getSingleElement in interface IScope
Overrides:
getSingleElement in class AbstractScope
Parameters:
name - the name of the to-be-found element. May not be null.
Returns:
the first element that matches the name. May be null.

getElements

public java.lang.Iterable<IEObjectDescription> getElements(QualifiedName name)
Description copied from interface: IScope
Find all descriptions that match the given name.

Specified by:
getElements in interface IScope
Overrides:
getElements in class AbstractScope
Parameters:
name - the name of the to-be-found elements. May not be null.
Returns:
all elements that match the name. Never null.

getElements

public java.lang.Iterable<IEObjectDescription> getElements(org.eclipse.emf.ecore.EObject object)
Description copied from interface: IScope
Find all descriptions that match the given instance.

Specified by:
getElements in interface IScope
Overrides:
getElements in class AbstractScope
Parameters:
object - the instance whose descriptions should be obtained. May not be null.
Returns:
all elements that match the instance. Never null.

filterResult

protected java.lang.Iterable<IEObjectDescription> filterResult(java.lang.Iterable<IEObjectDescription> unfiltered)

getAllElements

public java.lang.Iterable<IEObjectDescription> getAllElements()
Description copied from interface: IScope
Obtain all elements from the scope. Implementors a free to throw an UnsupportedOperationException if the scope cannot be enumerated.

Specified by:
getAllElements in interface IScope
Overrides:
getAllElements in class AbstractScope
Returns:
all elements of the scope. Never null.

internalGetAllElements

protected java.lang.Iterable<IEObjectDescription> internalGetAllElements()

getAllLocalElements

protected java.lang.Iterable<IEObjectDescription> getAllLocalElements()
Specified by:
getAllLocalElements in class AbstractScope

getTypeProvider

public IJvmTypeProvider getTypeProvider()

getQualifiedNameConverter

public IQualifiedNameConverter getQualifiedNameConverter()

toString

public java.lang.String toString()
Overrides:
toString in class AbstractScope