public class PivotEnvironmentFactory extends AbstractEnvironmentFactory
EnvironmentFactory
for parsing OCL expressions
on Ecore models.Modifier and Type | Field and Description |
---|---|
protected MetaModelManager |
metaModelManager |
Constructor and Description |
---|
PivotEnvironmentFactory()
Initializes me.
|
PivotEnvironmentFactory(org.eclipse.emf.ecore.EPackage.Registry reg,
MetaModelManager metaModelManager)
Initializes me with an
EPackage.Registry that the
environments I create will use to look up packages. |
Modifier and Type | Method and Description |
---|---|
PivotEnvironment |
createEnvironment()
Creates a root environment, in which package contexts and/or classifier
contexts will be created as nested environments.
|
PivotEnvironment |
createEnvironment(Environment parent)
Creates a child environment of a specified
parent , for
definition of nested scopes. |
PivotEvaluationEnvironment |
createEvaluationEnvironment()
Creates a new evaluation environment to track the values of variables in
an OCL expression as it is evaluated.
|
PivotEvaluationEnvironment |
createEvaluationEnvironment(EvaluationEnvironment parent)
Creates a new evaluation environment as a nested environment of the
specified parent.
|
static void |
disposeGlobalRegistryInstance()
Dispose of the global instance; this is intended for leakage detection in tests.
|
protected Type |
getClassifier(java.lang.Object context)
Obtains client metamodel's classifier for the specified
context object, which may be an instance of a classifier
in the user model or may actually be a classifier in the user model. |
org.eclipse.emf.ecore.EPackage.Registry |
getEPackageRegistry()
Obtains the package registry used by environment that I create to look
up packages.
|
static PivotEnvironmentFactory |
getGlobalRegistryInstance() |
MetaModelManager |
getMetaModelManager() |
PivotEnvironment |
loadEnvironment(org.eclipse.emf.ecore.resource.Resource resource)
Loads an environment from the specified resource.
|
createClassifierContext, createEvaluationVisitor, createInstanceContext, createOperationContext, createPackageContext, createPropertyContext, getAdapter, isEvaluationTracingEnabled, setEvaluationTracingEnabled
protected final MetaModelManager metaModelManager
public PivotEnvironmentFactory()
public PivotEnvironmentFactory(org.eclipse.emf.ecore.EPackage.Registry reg, @Nullable MetaModelManager metaModelManager)
EPackage.Registry
that the
environments I create will use to look up packages.reg
- my package registry (must not be null
)metaModelManager
- public static void disposeGlobalRegistryInstance()
@NonNull public static PivotEnvironmentFactory getGlobalRegistryInstance()
@NonNull public PivotEnvironment createEnvironment()
EnvironmentFactory
@NonNull public PivotEnvironment loadEnvironment(@NonNull org.eclipse.emf.ecore.resource.Resource resource)
EnvironmentFactory
resource
- a resource containing the persisted environmentpublic final org.eclipse.emf.ecore.EPackage.Registry getEPackageRegistry()
@NonNull public PivotEnvironment createEnvironment(@NonNull Environment parent)
EnvironmentFactory
parent
, for
definition of nested scopes.parent
- the parent environment@NonNull public PivotEvaluationEnvironment createEvaluationEnvironment()
EnvironmentFactory
@NonNull public PivotEvaluationEnvironment createEvaluationEnvironment(@NonNull EvaluationEnvironment parent)
EnvironmentFactory
parent
- a nesting evaluation environment@NonNull protected Type getClassifier(@NonNull java.lang.Object context)
AbstractEnvironmentFactory
context
object, which may be an instance of a classifier
in the user model or may actually be a classifier in the user model.getClassifier
in class AbstractEnvironmentFactory
context
- a context object or classifier@NonNull public MetaModelManager getMetaModelManager()