public abstract class AbstractEnvironmentFactory extends AbstractCustomizable implements EnvironmentFactoryInternal.EnvironmentFactoryInternalExtension
EnvironmentFactoryInternal
interface, useful
for subclassing to define the Pivot binding for a metamodel.EnvironmentFactoryInternal.EnvironmentFactoryInternalExtension
EnvironmentFactory.EnvironmentFactoryExtension
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.emf.ecore.resource.ResourceSet |
externalResourceSet |
protected boolean |
externalResourceSetWasNull |
protected ProjectManager |
projectManager |
Modifier | Constructor and Description |
---|---|
protected |
AbstractEnvironmentFactory(ProjectManager projectManager,
org.eclipse.emf.ecore.resource.ResourceSet externalResourceSet) |
Modifier and Type | Method and Description |
---|---|
EnvironmentFactoryAdapter |
adapt(org.eclipse.emf.common.notify.Notifier notifier) |
void |
addExternal2AS(External2AS external2as) |
void |
addExternalResources(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Add all resources in ResourceSet to the externalResourceSet.
|
void |
attach(java.lang.Object object) |
protected PivotMetamodelManager |
basicGetMetamodelManager() |
void |
configureLoadFirstStrategy()
Configure the PackageRegistry associated with the (external) ResourceSet to use a load strategy that uses whichever of
the namespace or platform URI is first encountered and which suppresses diagnostics about subsequent use of the
other form of URI.
|
void |
configureLoadStrategy(ProjectManager.IResourceLoadStrategy packageLoadStrategy,
ProjectManager.IConflictHandler conflictHandler)
Configure the PackageRegistry associated with the (external) ResourceSet to use a packageLoadStrategy and conflictHandler when
resolving namespace and platform URIs.
|
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl |
createASResourceSet()
Create and initialize the AS ResourceSet used by metamodelManager to contain the AS forms of CS and Ecore/UML resources.
|
CompleteEnvironmentInternal |
createCompleteEnvironment() |
EvaluationEnvironment |
createEvaluationEnvironment(EvaluationEnvironment parent,
NamedElement executableObject)
Deprecated.
no longer used
|
EvaluationEnvironment |
createEvaluationEnvironment(NamedElement executableObject,
ModelManager modelManager)
Creates a new evaluation environment to track the values of variables in
an OCL expression as it is evaluated.
|
EvaluationVisitor |
createEvaluationVisitor(EvaluationEnvironment evaluationEnvironment)
Creates a new evaluation visitor, for the evaluation of OCL expressions.
|
EvaluationVisitor |
createEvaluationVisitor(java.lang.Object context,
ExpressionInOCL expression,
ModelManager modelManager)
Creates a new evaluation visitor, for the evaluation of an OCL expression on a context using an environment and a modelManager.
|
ExecutorInternal |
createExecutor(ModelManager modelManager)
Create an Executor for OCL evaluation.
|
IdResolver |
createIdResolver()
Create and initialize the IdResolver used by metamodelManager to convert Ids to Elements.
|
ImplementationManager |
createImplementationManager() |
PivotMetamodelManager |
createMetamodelManager() |
protected ModelManager |
createModelManager() |
ModelManager |
createModelManager(java.lang.Object object)
Creates an extent map for invocation of OclType.allInstances()
using the specified
object as a context from which to find
the scope in which OCL classifier extents are defined. |
OCLInternal |
createOCL()
Creates a new
OCL instance attached to this EnvironmentFactory . |
ParserContext |
createParserContext(org.eclipse.emf.ecore.EObject context)
Create a ParserContext that may be used to parse OCL expressions in the given context,
which may be an EClassifier/EOperation/EStructuralFeature or Type/Operation/Property.
|
TemplateParameterSubstitutionVisitor |
createTemplateParameterSubstitutionVisitor(Type selfType,
Type selfTypeValue)
Create a visitor to resolve TemplateParameter specializations.
|
protected java.util.HashMap<java.lang.Object,StatusCodes.Severity> |
createValidationKey2severityMap() |
void |
detach(java.lang.Object object) |
void |
dispose() |
protected void |
disposeInternal() |
<T> T |
getAdapter(java.lang.Class<T> adapterType)
The abstract environment factory implementation is adaptable.
|
protected Class |
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. |
CompleteEnvironmentInternal |
getCompleteEnvironment()
Return the CompleteEnvironment that supervises the additional types need for collections specializations and tuples.
|
CompleteModelInternal |
getCompleteModel()
Return the CompleteModel that contains all the CompletePackages, which in turn contain all the CompleteClasses that
define the merge of individual Packages and Classes.
|
ICSI2ASMapping |
getCSI2ASMapping() |
java.lang.String |
getDoSetupName(org.eclipse.emf.common.util.URI uri) |
IdResolver |
getIdResolver()
Return the IdResolver that performs the resolution of the lightweight usage-independent Ids of types and packages
into the full usage-specific equivalents.
|
PivotMetamodelManager |
getMetamodelManager()
Return the MetamodelManager used to supervise the normalized Abstract Syntax representations of the metamodels.
|
protected EnvironmentFactoryInternal |
getParent() |
ProjectManager |
getProjectManager()
Return the ProjectMap used to resolve EPackages.
|
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet()
Return the external ResourceSet used to hold External Syntax (e.g.
|
StatusCodes.Severity |
getSeverity(java.lang.Object validationKey)
Return the StatusCodes severity with which the validation identified by validationKey is reported.
|
StandardLibraryInternal |
getStandardLibrary()
Return the (OCL) Standard Library that provides the build-in language facilities such as the OclAny and Set types.
|
Technology |
getTechnology() |
boolean |
isEvaluationTracingEnabled()
Queries whether tracing of evaluation is enabled.
|
org.eclipse.emf.ecore.EPackage |
loadEPackage(org.eclipse.emf.ecore.EPackage ePackage)
Ensure that EPackage has been loaded in the externalResourceSet PackageRegistry.
|
Element |
loadResource(org.eclipse.emf.ecore.resource.Resource resource,
org.eclipse.emf.common.util.URI uri) |
void |
resetSeverities() |
void |
setCSI2ASMapping(ICSI2ASMapping csi2asMapping) |
void |
setEvaluationTracingEnabled(boolean b)
Sets whether tracing of evaluation is enabled.
|
void |
setProject(org.eclipse.core.resources.IProject project)
Specify an Eclipse project with respect to which project-specific preferences are resolved.
|
void |
setSafeNavigationValidationSeverity(StatusCodes.Severity severity)
Configure safe navigation validation severities.
|
StatusCodes.Severity |
setSeverity(java.lang.Object validationKey,
StatusCodes.Severity severity)
Define the StatusCodes severity with which the validation identified by validationKey is reported.
|
basicGetOptions, clearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOption
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOption
@NonNull protected final ProjectManager projectManager
@NonNull protected final org.eclipse.emf.ecore.resource.ResourceSet externalResourceSet
protected final boolean externalResourceSetWasNull
protected AbstractEnvironmentFactory(@NonNull ProjectManager projectManager, @Nullable org.eclipse.emf.ecore.resource.ResourceSet externalResourceSet)
projectManager
- @NonNull public EnvironmentFactoryAdapter adapt(@NonNull org.eclipse.emf.common.notify.Notifier notifier)
adapt
in interface EnvironmentFactory
public void addExternal2AS(@NonNull External2AS external2as)
addExternal2AS
in interface EnvironmentFactoryInternal
public void addExternalResources(@NonNull org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
addExternalResources
in interface EnvironmentFactoryInternal
public void attach(java.lang.Object object)
attach
in interface EnvironmentFactoryInternal
@Nullable protected PivotMetamodelManager basicGetMetamodelManager()
public void configureLoadFirstStrategy()
EnvironmentFactoryInternal
configureLoadFirstStrategy
in interface EnvironmentFactoryInternal
public void configureLoadStrategy(ProjectManager.IResourceLoadStrategy packageLoadStrategy, ProjectManager.IConflictHandler conflictHandler)
EnvironmentFactoryInternal
configureLoadStrategy
in interface EnvironmentFactoryInternal
@NonNull public org.eclipse.emf.ecore.resource.impl.ResourceSetImpl createASResourceSet()
EnvironmentFactoryInternal
createASResourceSet
in interface EnvironmentFactoryInternal
@NonNull public CompleteEnvironmentInternal createCompleteEnvironment()
createCompleteEnvironment
in interface EnvironmentFactoryInternal
@NonNull public EvaluationEnvironment createEvaluationEnvironment(@NonNull NamedElement executableObject, @NonNull ModelManager modelManager)
EnvironmentFactory
createEvaluationEnvironment
in interface EnvironmentFactory
@Deprecated @NonNull public EvaluationEnvironment createEvaluationEnvironment(@NonNull EvaluationEnvironment parent, @NonNull NamedElement executableObject)
createEvaluationEnvironment
in interface EnvironmentFactory
@NonNull public EvaluationVisitor createEvaluationVisitor(@Nullable java.lang.Object context, @NonNull ExpressionInOCL expression, @Nullable ModelManager modelManager)
EnvironmentFactory
createEvaluationVisitor
in interface EnvironmentFactory
@NonNull public EvaluationVisitor createEvaluationVisitor(@NonNull EvaluationEnvironment evaluationEnvironment)
EnvironmentFactory
createEvaluationVisitor
in interface EnvironmentFactory
evaluationEnvironment
- the evaluation environment that the visitor is to use
for tracking variables, navigating properties, etc.@NonNull public ExecutorInternal createExecutor(@NonNull ModelManager modelManager)
EnvironmentFactory.EnvironmentFactoryExtension
createExecutor
in interface EnvironmentFactory.EnvironmentFactoryExtension
@NonNull public IdResolver createIdResolver()
EnvironmentFactoryInternal
createIdResolver
in interface EnvironmentFactoryInternal
@NonNull public ImplementationManager createImplementationManager()
createImplementationManager
in interface EnvironmentFactoryInternal
@NonNull public PivotMetamodelManager createMetamodelManager()
createMetamodelManager
in interface EnvironmentFactoryInternal
@NonNull protected ModelManager createModelManager()
@NonNull public ModelManager createModelManager(@Nullable java.lang.Object object)
object
as a context from which to find
the scope in which OCL classifier extents are defined. This scope may
be a resource, resource set, or some metamodel-specific scope. Note that
in the case that the object
is not an
EObject
but is, instead, some primitive
type, then this may be difficult to determine.
Clients are encouraged to do what they can to optimize this mapping, by
lazy initialization of key-value pairs, workspace indices, or whatever
means is available. Note that the map will only ever be accessed by
key (Map.get(java.lang.Object)
); it will never be queried for
all entries, all keys, all values, etc. This knowledge could help
optimization.
createModelManager
in interface EnvironmentFactory
object
- a context object in the scope that covers the OCL
classifier extents@NonNull public OCLInternal createOCL()
EnvironmentFactory
Creates a new OCL
instance attached to this EnvironmentFactory
.
Clients should call OCL.dispose()
to detach once they have no further use for
the OCL.
createOCL
in interface EnvironmentFactoryInternal
createOCL
in interface EnvironmentFactory
OCL
instance attached to this EnvironmentFactory
@NonNull public ParserContext createParserContext(@Nullable org.eclipse.emf.ecore.EObject context)
EnvironmentFactoryInternal
createParserContext
in interface EnvironmentFactoryInternal
@NonNull public TemplateParameterSubstitutionVisitor createTemplateParameterSubstitutionVisitor(@Nullable Type selfType, @Nullable Type selfTypeValue)
EnvironmentFactoryInternal.EnvironmentFactoryInternalExtension
createTemplateParameterSubstitutionVisitor
in interface EnvironmentFactoryInternal.EnvironmentFactoryInternalExtension
@NonNull protected java.util.HashMap<java.lang.Object,StatusCodes.Severity> createValidationKey2severityMap()
public void detach(java.lang.Object object)
detach
in interface EnvironmentFactoryInternal
public void dispose()
dispose
in interface EnvironmentFactoryInternal
protected void disposeInternal()
@Nullable public <T> T getAdapter(java.lang.Class<T> adapterType)
Subclasses may override or extend this implementation.
getAdapter
in interface Adaptable
getAdapter
in class AbstractCustomizable
T
- the requested adapter interfaceadapterType
- the requested adapter interfacenull
if this environment does not adapt to itprotected Class getClassifier(@NonNull java.lang.Object context)
context
object, which may be an instance of a classifier
in the user model or may actually be a classifier in the user model.context
- a context object or classifier@NonNull public CompleteEnvironmentInternal getCompleteEnvironment()
EnvironmentFactory
getCompleteEnvironment
in interface EnvironmentFactoryInternal
getCompleteEnvironment
in interface EnvironmentFactory
@NonNull public CompleteModelInternal getCompleteModel()
EnvironmentFactory
getCompleteModel
in interface EnvironmentFactoryInternal
getCompleteModel
in interface EnvironmentFactory
@Nullable public ICSI2ASMapping getCSI2ASMapping()
getCSI2ASMapping
in interface EnvironmentFactoryInternal
@Nullable public java.lang.String getDoSetupName(@NonNull org.eclipse.emf.common.util.URI uri)
getDoSetupName
in interface EnvironmentFactoryInternal
@NonNull public IdResolver getIdResolver()
EnvironmentFactory
getIdResolver
in interface EnvironmentFactory
@NonNull public PivotMetamodelManager getMetamodelManager()
EnvironmentFactory
getMetamodelManager
in interface EnvironmentFactoryInternal
getMetamodelManager
in interface EnvironmentFactory
@Nullable protected EnvironmentFactoryInternal getParent()
getParent
in class AbstractCustomizable
@NonNull public ProjectManager getProjectManager()
getProjectManager
in interface EnvironmentFactory
@NonNull public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
EnvironmentFactory
getResourceSet
in interface EnvironmentFactory
public StatusCodes.Severity getSeverity(@Nullable java.lang.Object validationKey)
EnvironmentFactory
getSeverity
in interface EnvironmentFactory
@NonNull public StandardLibraryInternal getStandardLibrary()
EnvironmentFactory
getStandardLibrary
in interface EnvironmentFactoryInternal
getStandardLibrary
in interface EnvironmentFactory
@NonNull public Technology getTechnology()
getTechnology
in interface EnvironmentFactoryInternal
public boolean isEvaluationTracingEnabled()
In an Eclipse environment, tracing is also enabled by turning on the org.eclipse.ocl/debug/evaluation debug option.
isEvaluationTracingEnabled
in interface EnvironmentFactory.EnvironmentFactoryExtension
setEvaluationTracingEnabled(boolean)
public org.eclipse.emf.ecore.EPackage loadEPackage(@NonNull org.eclipse.emf.ecore.EPackage ePackage)
EnvironmentFactoryInternal
loadEPackage
in interface EnvironmentFactoryInternal
@Nullable public Element loadResource(@NonNull org.eclipse.emf.ecore.resource.Resource resource, @Nullable org.eclipse.emf.common.util.URI uri) throws ParserException
loadResource
in interface EnvironmentFactoryInternal
ParserException
public void resetSeverities()
public void setCSI2ASMapping(ICSI2ASMapping csi2asMapping)
setCSI2ASMapping
in interface EnvironmentFactoryInternal
public void setEvaluationTracingEnabled(boolean b)
In an Eclipse environment, tracing is also enabled by turning on the org.eclipse.ocl/debug/evaluation debug option.
param b whether evaluation tracing is enabledsetEvaluationTracingEnabled
in interface EnvironmentFactoryInternal
isEvaluationTracingEnabled()
public void setProject(@Nullable org.eclipse.core.resources.IProject project)
EnvironmentFactoryInternal
setProject
in interface EnvironmentFactoryInternal
public void setSafeNavigationValidationSeverity(StatusCodes.Severity severity)
setSafeNavigationValidationSeverity
in interface EnvironmentFactoryInternal
public StatusCodes.Severity setSeverity(@NonNull java.lang.Object validationKey, StatusCodes.Severity severity)
EnvironmentFactory
setSeverity
in interface EnvironmentFactory