|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ocl.examples.pivot.AbstractBasicEnvironment<Environment>
org.eclipse.ocl.examples.pivot.AbstractEnvironment
public abstract class AbstractEnvironment
A partial implementation of the Environment
interface providing
some useful common behavior for providers of metamodel bindings. It is
recommended to extend this class rather than to implement the
Environment
interface from scratch.
In particular, this class provides:
along with some subclass hook methods and convenience methods.
See the Environment
class for a description of the
generic type parameters of this class.
Nested Class Summary | |
---|---|
protected class |
AbstractEnvironment.VariableEntry
Wrapper for OCL variable declarations that additionally tracks whether they are explicit or implicit variables. |
Nested classes/interfaces inherited from interface org.eclipse.ocl.examples.pivot.Environment |
---|
Environment.Registry |
Field Summary |
---|
Fields inherited from class org.eclipse.ocl.examples.pivot.AbstractBasicEnvironment |
---|
parent |
Fields inherited from interface org.eclipse.ocl.examples.pivot.Environment |
---|
OCL_NAMESPACE_URI, RESULT_VARIABLE_NAME, SELF_VARIABLE_NAME |
Constructor Summary | |
---|---|
protected |
AbstractEnvironment()
Initializes me without a parent environment. |
protected |
AbstractEnvironment(Environment parent)
Initializes me with the specified parent environment. |
Method Summary | |
---|---|
boolean |
addElement(java.lang.String name,
Variable elem,
boolean isExplicit)
Adds a variable declaration to the environment. |
void |
dispose()
I dispose my type resolver, if it is an AbstractTypeResolver
and I am the root environment (which owns the resolver). |
Type |
getContextClassifier()
Obtains the context classifier of this environment. |
Operation |
getContextOperation()
Obtains the context operation of this environment, if it is an operation context. |
Package |
getContextPackage()
Initializes me with the specified parent environment, which should be of the same type as me. |
Property |
getContextProperty()
Obtains the context property of this environment, if it is a property context. |
Variable |
getSelfVariable()
Gets the self variable, looking it up in a parent environment if necessary. |
protected void |
setContextOperation(Operation contextOperation)
Assigns my context operation. |
protected void |
setContextPackage(Package contextPackage)
Assigns my context package. |
protected void |
setContextProperty(Property contextProperty)
Assigns my context property. |
void |
setSelfVariable(Variable var)
Sets the "self" variable that is the implicit source of any property, operation, or association class call. |
Methods inherited from class org.eclipse.ocl.examples.pivot.AbstractBasicEnvironment |
---|
basicGetOptions, clearOptions, getAdapter, getOptions, getParent, getValue, isEnabled, notOK, putOptions, removeOption, removeOptions, setOption, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ocl.examples.pivot.Environment |
---|
getDefinition, getFactory, getMetaModelManager, getOCLFactory, getOCLStandardLibrary, getParent, getStates |
Methods inherited from interface org.eclipse.ocl.examples.pivot.Adaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ocl.examples.pivot.Customizable |
---|
clearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOption |
Constructor Detail |
---|
protected AbstractEnvironment()
protected AbstractEnvironment(Environment parent)
parent
- an environment (or null
)Method Detail |
---|
public boolean addElement(@NonNull java.lang.String name, @NonNull Variable elem, boolean isExplicit)
Environment
addElement
in interface Environment
name
- the name of the variable, or null
elem
- a variable declarationisExplicit
- whether this is an explicitly declared variable
true
if the variable was successfully added because
it wasn't already declared locally in this environment;
false
, otherwisepublic void dispose()
AbstractTypeResolver
and I am the root environment (which owns the resolver).
dispose
in interface Environment
@Nullable public Package getContextPackage()
getContextPackage
in interface Environment
parent
- an environment of the same type as me (or null
)
Environment.getContextClassifier()
@Nullable public Type getContextClassifier()
Environment
getContextClassifier
in interface Environment
@Nullable public Operation getContextOperation()
Environment
getContextOperation
in interface Environment
null
if this is not an
operation environment@Nullable public Property getContextProperty()
Environment
getContextProperty
in interface Environment
null
if this is not a
property environment@Nullable public Variable getSelfVariable()
Environment
getSelfVariable
in interface Environment
null
if none (which should
only be the case in a root environment having only a package context,
if even that)protected void setContextOperation(@Nullable Operation contextOperation)
contextOperation
- my context operationprotected void setContextPackage(@Nullable Package contextPackage)
contextPackage
- my new context packageprotected void setContextProperty(@Nullable Property contextProperty)
contextProperty
- my context propertypublic void setSelfVariable(@NonNull Variable var)
Environment
setSelfVariable
in interface Environment
var
- the "self" variable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |