|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.examples.pivot.AbstractBasicEnvironment 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.Internal, Environment.Registry |
Field Summary |
---|
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(AbstractEnvironment parent)
Initializes me with the specified parent environment, which should be of the same type as me. |
protected |
AbstractEnvironment(Environment.Internal 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()
|
Package |
getContextPackage()
Obtains my context package, if any. |
Environment.Internal |
getInternalParent()
Obtains my parent environment after construction. |
AbstractEnvironment |
getParent()
Deprecated. Since 1.2, use the getInternalParent() method, instead. |
Variable |
getSelfVariable()
Gets the self variable, looking it up in a parent environment if necessary. |
boolean |
notOK(Option<ProblemHandler.Severity> option)
Queries whether I have a non-OK setting for the specified problem option. |
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 |
setInternalParent(Environment.Internal parent)
Assigns me a parent environment after construction. |
protected void |
setParent(AbstractEnvironment parent)
Assigns me a parent environment after construction. |
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, getValue, isEnabled, 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.Adaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ocl.examples.pivot.Customizable |
---|
clearOptions, getOptions, getValue, isEnabled, putOptions, removeOption, removeOptions, setOption |
Methods inherited from interface org.eclipse.ocl.examples.pivot.Environment |
---|
getDefinition, getFactory, getOCLFactory, getOCLStandardLibrary, getStates, getTypeManager |
Constructor Detail |
---|
protected AbstractEnvironment()
protected AbstractEnvironment(Environment.Internal parent)
parent
- an environment (or null
)protected AbstractEnvironment(AbstractEnvironment parent)
parent
- an environment of the same type as me (or null
)Method Detail |
---|
public Environment.Internal getInternalParent()
Environment.Internal
getInternalParent
in interface Environment.Internal
@Deprecated public AbstractEnvironment getParent()
getInternalParent()
method, instead.
Environment
getParent
in interface Environment
getParent
in class AbstractBasicEnvironment
null
if I am a root environmentpublic void setInternalParent(Environment.Internal parent)
null
if I previously had one.
setInternalParent
in interface Environment.Internal
parent
- my new parentprotected void setParent(AbstractEnvironment parent)
null
if I previously had one.
parent
- my new parentpublic Package getContextPackage()
Environment
getContextPackage
in interface Environment
#getContextClassifier()
protected void setContextPackage(Package contextPackage)
contextPackage
- my new context packagepublic Type getContextClassifier()
protected void setContextOperation(Operation contextOperation)
contextOperation
- my context operationprotected void setContextProperty(Property contextProperty)
contextProperty
- my context propertypublic boolean addElement(java.lang.String name, 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 setSelfVariable(Variable var)
Environment
setSelfVariable
in interface Environment
var
- the "self" variablepublic 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)public boolean notOK(Option<ProblemHandler.Severity> option)
option
- the problem option
ProblemHandler.Severity.OK
public void dispose()
AbstractTypeResolver
and I am the root environment (which owns the resolver).
dispose
in interface Environment.Internal
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |