public class EMFScope extends QueryScope
QueryScope
consisting of EMF objects contained in multiple ResourceSet
s, a single ResourceSet
, Resource
or a containment subtree below a given EObject
.
The scope is characterized by a root and some options (see BaseIndexOptions
) such as dynamic EMF mode, subtree filtering etc.
The scope of pattern matching will be the given EMF model root(s) and below (see FAQ for more precise definition).
Note on cross-resource containment: in case of EObject
scopes, cross-resource containments will be considered part of the scope.
The same goes for ResourceSet
scopes, provided that the resource of the contained element is successfully loaded into the resource set.
In case of a Resource
scope, containments pointing out from the resource will be excluded from the scope.
Thus the boundaries of EObject
scopes conform to the notion of EMF logical containment, while Resource
and ResourceSet
scopes adhere to persistence boundaries.
Constructor and Description |
---|
EMFScope(org.eclipse.emf.common.notify.Notifier scopeRoot)
Creates an EMF scope at the given root, with default options (recommended for most users).
|
EMFScope(org.eclipse.emf.common.notify.Notifier scopeRoot,
BaseIndexOptions options)
Creates an EMF scope at the given root, with customizable options.
|
EMFScope(java.util.Set<? extends org.eclipse.emf.common.notify.Notifier> scopeRoots,
BaseIndexOptions options)
Creates an EMF scope at the given roots, with customizable options.
|
EMFScope(java.util.Set<? extends org.eclipse.emf.ecore.resource.ResourceSet> scopeRoots)
Creates an EMF scope at the given roots, with default options (recommended for most users).
|
Modifier and Type | Method and Description |
---|---|
protected IEngineContext |
createEngineContext(ViatraQueryEngine engine,
IIndexingErrorListener errorListener,
org.apache.log4j.Logger logger) |
boolean |
equals(java.lang.Object obj) |
static NavigationHelper |
extractUnderlyingEMFIndex(ViatraQueryEngine engine)
Provides access to the underlying EMF model index (
NavigationHelper ) from a VIATRA Query engine instantiated on an EMFScope |
BaseIndexOptions |
getOptions() |
java.util.Set<? extends org.eclipse.emf.common.notify.Notifier> |
getScopeRoots() |
int |
hashCode() |
java.lang.String |
toString() |
isCompatibleWithQueryScope
public EMFScope(org.eclipse.emf.common.notify.Notifier scopeRoot) throws ViatraQueryException
scopeRoot
- the root of the EMF scopeViatraQueryException-
- if scopeRoot is not an EMF ResourceSet, Resource or EObjectViatraQueryException
public EMFScope(org.eclipse.emf.common.notify.Notifier scopeRoot, BaseIndexOptions options) throws ViatraQueryException
Most users should consider EMFScope(Notifier)
instead.
scopeRoot
- the root of the EMF scopeoptions
- the base index building settingsViatraQueryException
- if scopeRoot is not an EMF ResourceSet, Resource or EObjectpublic EMFScope(java.util.Set<? extends org.eclipse.emf.ecore.resource.ResourceSet> scopeRoots) throws ViatraQueryException
scopeRoots
- the roots of the EMF scope, must be ResourceSet
sViatraQueryException
- if not all scopeRoots are ResourceSet
spublic EMFScope(java.util.Set<? extends org.eclipse.emf.common.notify.Notifier> scopeRoots, BaseIndexOptions options) throws ViatraQueryException
Most users should consider EMFScope(Set)
instead.
scopeRoots
- the roots of the EMF scope, must be ResourceSet
soptions
- the base index building settingsViatraQueryException
- if not all scopeRoots are ResourceSet
spublic java.util.Set<? extends org.eclipse.emf.common.notify.Notifier> getScopeRoots()
ResourceSet
s) containing the modelpublic BaseIndexOptions getOptions()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected IEngineContext createEngineContext(ViatraQueryEngine engine, IIndexingErrorListener errorListener, org.apache.log4j.Logger logger)
createEngineContext
in class org.eclipse.viatra.query.runtime.internal.apiimpl.EngineContextFactory
public static NavigationHelper extractUnderlyingEMFIndex(ViatraQueryEngine engine) throws ViatraQueryException
NavigationHelper
) from a VIATRA Query engine instantiated on an EMFScopeengine
- an already existing VIATRA Query engine instantiated on an EMFScopeViatraQueryException
- if base index initialization fails