|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.ocl.parser.AbstractEnvironmentFactory
Partial implementation of the EnvironmentFactory
interface, useful
for subclassing for client metamodels. This abstract class takes care of
some of the more common (and mundane) chores, such as:
The subclass's responsibility is to define how to:
EClassifier
APIEOperation
APIEStructuralFeature
APIEPackage
context (determined from the classifier context)This class is intended to be extended by clients, for the purpose of implementing metamodel-specified environment factories.
Field Summary |
---|
Fields inherited from interface org.eclipse.emf.ocl.parser.EnvironmentFactory |
---|
ECORE_INSTANCE |
Constructor Summary | |
---|---|
protected |
AbstractEnvironmentFactory()
Initializes me. |
Method Summary | |
---|---|
protected abstract org.eclipse.emf.ecore.EClassifier |
asEClassifier(java.lang.Object context)
Adapts the specified client metamodel context to the
EClassifier API. |
protected abstract org.eclipse.emf.ecore.EOperation |
asEOperation(java.lang.Object operation)
Adapts the specified client metamodel operation to the
EOperation API. |
protected abstract org.eclipse.emf.ecore.EStructuralFeature |
asEStructuralFeature(java.lang.Object property)
Adapts the specified client metamodel property to the
EStructuralFeature API. |
Environment |
createClassifierContext(java.lang.Object context)
Creates an environment suitable for parsing OCL expressions on the specified object , which is some classifier
in the client's metamodel or an instance thereof.
|
protected abstract Environment |
createEnvironment(org.eclipse.emf.ecore.EPackage packageContext)
Implemented by subclasses to create a new environment implementation on the specified package context. |
EvaluationEnvironment |
createEvaluationEnvironment()
Default evaluation environment is implemented as a Map
of String ==> Object . |
java.util.Map |
createExtentMap(java.lang.Object object)
Default implementation considers the resource containing an EObject as defining the scope of the OCL classifier extents. |
Environment |
createOperationContext(java.lang.Object context,
java.lang.Object operation)
Creates an environment suitable for parsing OCL expressions on the specified operation , which is some operation
in the client's metamodel. |
Environment |
createPackageContext(java.util.List pathname)
Creates an environment suitable for parsing OCL expressions in the specified package context. |
Environment |
createPropertyContext(java.lang.Object context,
java.lang.Object property)
Creates an environment suitable for parsing OCL expressions on the specified property , which is some property
in the client's metamodel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.ocl.parser.EnvironmentFactory |
---|
createEnvironment |
Constructor Detail |
protected AbstractEnvironmentFactory()
Method Detail |
protected abstract Environment createEnvironment(org.eclipse.emf.ecore.EPackage packageContext)
AbstractEnvironmentFactory.asEClassifier(Object)
method.
packageContext
- the OCL package context (not null
)
protected abstract org.eclipse.emf.ecore.EClassifier asEClassifier(java.lang.Object context)
context
to the
EClassifier
API. This might just return the context
if it already is an EClassifier
, or might return its type if it
is an instance of an EClassifier
, or adapt it by some other
means to the EClassifier
API.
context
- a classifier in the client metamodel's definition of
what an OCL classifier is, or an instance thereof
protected abstract org.eclipse.emf.ecore.EOperation asEOperation(java.lang.Object operation)
operation
to the
EOperation
API.
operation
- an operation in the client metamodel's definition of
what an OCL operation is
protected abstract org.eclipse.emf.ecore.EStructuralFeature asEStructuralFeature(java.lang.Object property)
property
to the
EStructuralFeature
API.
property
- a property in the client metamodel's definition of
what an OCL property is
public Environment createClassifierContext(java.lang.Object context)
EnvironmentFactory
object
, which is some classifier
in the client's metamodel or an instance thereof.
The context may be either the specific model element or primitive value
on which an OCL expression would be evaluated, or it may be an
EClassifier
of the target metamodel against which an OCL
expression would be parsed. Note that, in the former case, the actual
OCL context classifier (as an OCL type or EClassifier
) will be
inferred from the context object according to the nature of the
environment factory
createClassifierContext
in interface EnvironmentFactory
context
- the context object or classifier
EnvironmentFactory.createOperationContext(Object, Object)
public Environment createPackageContext(java.util.List pathname)
EnvironmentFactory
createPackageContext
in interface EnvironmentFactory
pathname
- the qualified package name (the ::-separated parts)
EnvironmentFactory.createClassifierContext(Object)
,
EnvironmentFactory.createOperationContext(Object, Object)
public Environment createOperationContext(java.lang.Object context, java.lang.Object operation)
EnvironmentFactory
operation
, which is some operation
in the client's metamodel. Note that operation contexts can be defined
in the context of any classifier to which that operation is applicable.
createOperationContext
in interface EnvironmentFactory
operation
- an operation in the client's metamodel
EnvironmentFactory.createClassifierContext(Object)
public Environment createPropertyContext(java.lang.Object context, java.lang.Object property)
EnvironmentFactory
property
, which is some property
in the client's metamodel. Note that property contexts can be defined
in the context of any classifier in which that property is available.
createPropertyContext
in interface EnvironmentFactory
property
- a property (structural feature) in the client's metamodel
EnvironmentFactory.createClassifierContext(Object)
public EvaluationEnvironment createEvaluationEnvironment()
Map
of String
==> Object
.
createEvaluationEnvironment
in interface EnvironmentFactory
public java.util.Map createExtentMap(java.lang.Object object)
object
is not an EObject
, we have no
access to any such scope, so all extents will be empty.
createExtentMap
in interface EnvironmentFactory
object
- a context object in the scope that covers the OCL
classifier extents
|
Copyright 2002, 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |