org.eclipse.xtend.core.scoping
Class XtendImportedNamespaceScopeProvider
java.lang.Object
org.eclipse.xtext.scoping.impl.AbstractScopeProvider
org.eclipse.xtext.scoping.impl.AbstractGlobalScopeDelegatingScopeProvider
org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider
org.eclipse.xtext.xbase.scoping.XbaseImportedNamespaceScopeProvider
org.eclipse.xtend.core.scoping.XtendImportedNamespaceScopeProvider
- All Implemented Interfaces:
- IScopeProvider
public class XtendImportedNamespaceScopeProvider
- extends XbaseImportedNamespaceScopeProvider
- Author:
- Jan Koehnlein - Initial contribution and API, Sebastian Zarnekow - Improved support for nested types in connection with imports
Method Summary |
protected ImportNormalizer |
createImportedNamespaceResolver(java.lang.String namespace,
boolean ignoreCase)
Create a new ImportNormalizer for the given namespace. |
protected ImportScope |
createImportScope(IScope parent,
java.util.List<ImportNormalizer> namespaceResolvers,
ISelectable importFrom,
org.eclipse.emf.ecore.EClass type,
boolean ignoreCase)
|
protected ImportNormalizer |
doCreateImportNormalizer(QualifiedName importedNamespace,
boolean wildcard,
boolean ignoreCase)
|
protected java.util.List<ImportNormalizer> |
getDefaultImports()
|
protected java.util.List<ImportNormalizer> |
getImplicitImports(boolean ignoreCase)
|
protected IScope |
getLocalElementsScope(IScope parent,
org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
|
IScope |
getScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
Returns a scope for the given context. |
protected java.util.List<ImportNormalizer> |
internalGetImportedNamespaceResolvers(org.eclipse.emf.ecore.EObject context,
boolean ignoreCase)
|
protected boolean |
isRelativeImport()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XtendImportedNamespaceScopeProvider
public XtendImportedNamespaceScopeProvider()
getScope
public IScope getScope(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
- Description copied from interface:
IScopeProvider
- Returns a scope for the given context. The scope provides access to the compatible
visible EObjects for a given reference.
- Specified by:
getScope
in interface IScopeProvider
- Overrides:
getScope
in class ImportedNamespaceAwareLocalScopeProvider
- Parameters:
context
- the element from which an element shall be referenced. It doesn't need to be the element
containing the reference, it is just used to find the most inner scope for given EReference
.reference
- the reference for which to get the scope.
- Returns:
IScope
representing the inner most IScope
for the
passed context and reference. Note for implementors: The result may not be null
.
Return IScope.NULLSCOPE
instead.
internalGetImportedNamespaceResolvers
protected java.util.List<ImportNormalizer> internalGetImportedNamespaceResolvers(org.eclipse.emf.ecore.EObject context,
boolean ignoreCase)
- Overrides:
internalGetImportedNamespaceResolvers
in class ImportedNamespaceAwareLocalScopeProvider
createImportedNamespaceResolver
protected ImportNormalizer createImportedNamespaceResolver(java.lang.String namespace,
boolean ignoreCase)
- Description copied from class:
ImportedNamespaceAwareLocalScopeProvider
- Create a new
ImportNormalizer
for the given namespace.
- Overrides:
createImportedNamespaceResolver
in class ImportedNamespaceAwareLocalScopeProvider
- Parameters:
namespace
- the namespace.ignoreCase
- true
if the resolver should be case insensitive.
- Returns:
- a new
ImportNormalizer
or null
if the namespace cannot be converted to a valid
qualified name.
getImplicitImports
protected java.util.List<ImportNormalizer> getImplicitImports(boolean ignoreCase)
- Overrides:
getImplicitImports
in class XbaseImportedNamespaceScopeProvider
getDefaultImports
protected java.util.List<ImportNormalizer> getDefaultImports()
doCreateImportNormalizer
protected ImportNormalizer doCreateImportNormalizer(QualifiedName importedNamespace,
boolean wildcard,
boolean ignoreCase)
getLocalElementsScope
protected IScope getLocalElementsScope(IScope parent,
org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference reference)
- Overrides:
getLocalElementsScope
in class ImportedNamespaceAwareLocalScopeProvider
isRelativeImport
protected boolean isRelativeImport()
- Overrides:
isRelativeImport
in class ImportedNamespaceAwareLocalScopeProvider
createImportScope
protected ImportScope createImportScope(IScope parent,
java.util.List<ImportNormalizer> namespaceResolvers,
ISelectable importFrom,
org.eclipse.emf.ecore.EClass type,
boolean ignoreCase)
- Overrides:
createImportScope
in class ImportedNamespaceAwareLocalScopeProvider