|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ocl.examples.pivot.evaluation.AbstractEvaluationEnvironment
public abstract class AbstractEvaluationEnvironment
A partial implementation of the EvaluationEnvironment
interface,
providing some useful common behaviors. Implementors of metamodel-specific
environments are encourage to extend this class rather than implement
an evaluation environment "from scratch."
See the Environment
class for a description of the
generic type parameters of this class.
Since the 1.2 release, this interface is Adaptable
to support the
optional adapter protocols such as EvaluationEnvironment.Enumerations
and Customizable
.
Field Summary | |
---|---|
protected MetaModelManager |
metaModelManager
|
Constructor Summary | |
---|---|
protected |
AbstractEvaluationEnvironment(EvaluationEnvironment parent)
|
protected |
AbstractEvaluationEnvironment(MetaModelManager metaModelManager)
|
Method Summary | ||
---|---|---|
void |
add(DomainTypedElement referredVariable,
Value value)
Adds the supplied name and value binding to the environment |
|
protected java.util.Map<Option<?>,java.lang.Object> |
basicGetOptions()
|
|
void |
clear()
Clears the environment of variables. |
|
java.util.Map<Option<?>,java.lang.Object> |
clearOptions()
Clears all options. |
|
|
getAdapter(java.lang.Class<T> adapterType)
Implements the interface method by testing whether I am an instance of the requested adapter type. |
|
MetaModelManager |
getMetaModelManager()
Obtains the Java-language value of the specified enumeration literal. |
|
java.util.Map<Option<?>,java.lang.Object> |
getOptions()
Obtains a copy of my map of options. |
|
protected EvaluationEnvironment |
getParent()
Obtains my parent (nesting) environment. |
|
|
getValue(Option<T> option)
Obtains the value of the specified option's setting in the my options map. |
|
Value |
getValueOf(VariableDeclaration referredVariable)
Returns the value associated with the supplied name |
|
boolean |
isEnabled(Option<java.lang.Boolean> option)
Queries whether the specified boolean-valued option is enabled. |
|
boolean |
overrides(Operation operation,
int opcode)
By default, a subclass will not support overriding the operations defined by the OCL Standard Library. |
|
|
putOptions(java.util.Map<? extends Option<T>,? extends T> options)
Adds options to apply to my behaviour. |
|
Value |
remove(DomainTypedElement referredVariable)
Deprecated. |
|
|
removeOption(Option<T> option)
Removes the specified option. |
|
|
removeOptions(java.util.Collection<Option<T>> options)
Removes the specified options. |
|
void |
replace(DomainTypedElement referredVariable,
Value value)
Replaces the current value of the supplied name with the supplied value. |
|
|
setOption(Option<T> option,
T value)
Add an option to apply to my behaviour. |
|
NullValue |
throwInvalidEvaluation(InvalidValueException e)
|
|
NullValue |
throwInvalidEvaluation(java.lang.String message)
|
|
NullValue |
throwInvalidEvaluation(java.lang.String message,
DomainExpression expression)
|
|
NullValue |
throwInvalidEvaluation(java.lang.String message,
DomainExpression expression,
java.lang.Object context)
|
|
NullValue |
throwInvalidEvaluation(java.lang.Throwable e,
DomainExpression expression,
java.lang.Object context,
java.lang.String message,
java.lang.Object... bindings)
|
|
java.lang.String |
toString()
Returns a string representation of the bindings |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.ocl.examples.pivot.evaluation.EvaluationEnvironment |
---|
createModelManager, getType, getValueFactory, navigateAssociationClass |
Methods inherited from interface org.eclipse.ocl.examples.domain.evaluation.DomainEvaluationEnvironment |
---|
createVariable |
Field Detail |
---|
protected final MetaModelManager metaModelManager
Constructor Detail |
---|
protected AbstractEvaluationEnvironment(MetaModelManager metaModelManager)
protected AbstractEvaluationEnvironment(EvaluationEnvironment parent)
Method Detail |
---|
public MetaModelManager getMetaModelManager()
EvaluationEnvironment
getMetaModelManager
in interface EvaluationEnvironment
protected EvaluationEnvironment getParent()
null
if nonepublic Value getValueOf(VariableDeclaration referredVariable)
getValueOf
in interface EvaluationEnvironment
name
- the name whose value is to be returned
public void replace(DomainTypedElement referredVariable, Value value)
replace
in interface DomainEvaluationEnvironment
replace
in interface EvaluationEnvironment
name
- the namevalue
- the new valuepublic void add(DomainTypedElement referredVariable, Value value)
add
in interface DomainEvaluationEnvironment
add
in interface EvaluationEnvironment
name
- the name to addvalue
- the associated binding#replace(String, Object)
@Deprecated public Value remove(DomainTypedElement referredVariable)
remove
in interface EvaluationEnvironment
name
- the name to remove
public void clear()
clear
in interface EvaluationEnvironment
public java.lang.String toString()
toString
in class java.lang.Object
public boolean overrides(Operation operation, int opcode)
false
.
overrides
in interface EvaluationEnvironment
operation
- an OCL operationopcode
- the operation code, if one of the operations pre-defined
by OCL. Otherwise, -1
true
if this evaluation environment provides an
implementation of this operation
; false
,
otherwise#callOperation
public <T> T getAdapter(java.lang.Class<T> adapterType)
getAdapter
in interface Adaptable
T
- the requested adapter interfaceadapterType
- the requested adapter interface
null
if this environment does not adapt to itprotected java.util.Map<Option<?>,java.lang.Object> basicGetOptions()
public java.util.Map<Option<?>,java.lang.Object> getOptions()
Customizable
getOptions
in interface Customizable
public <T> void setOption(Option<T> option, T value)
Customizable
setOption
in interface Customizable
option
- the optionvalue
- the option's valuepublic <T> void putOptions(java.util.Map<? extends Option<T>,? extends T> options)
Customizable
putOptions
in interface Customizable
options
- the optionspublic <T> T removeOption(Option<T> option)
Customizable
removeOption
in interface Customizable
option
- the option to remove
public <T> java.util.Map<Option<T>,T> removeOptions(java.util.Collection<Option<T>> options)
Customizable
removeOptions
in interface Customizable
options
- the options to remove
public java.util.Map<Option<?>,java.lang.Object> clearOptions()
Customizable
clearOptions
in interface Customizable
public boolean isEnabled(Option<java.lang.Boolean> option)
Customizable
isEnabled
in interface Customizable
option
- an option
public <T> T getValue(Option<T> option)
Customizable
getValue
in interface Customizable
option
- the option to query
public NullValue throwInvalidEvaluation(InvalidValueException e) throws InvalidEvaluationException
throwInvalidEvaluation
in interface EvaluationEnvironment
InvalidEvaluationException
public NullValue throwInvalidEvaluation(java.lang.String message) throws InvalidEvaluationException
throwInvalidEvaluation
in interface EvaluationEnvironment
InvalidEvaluationException
public NullValue throwInvalidEvaluation(java.lang.String message, DomainExpression expression) throws InvalidEvaluationException
throwInvalidEvaluation
in interface EvaluationEnvironment
InvalidEvaluationException
public NullValue throwInvalidEvaluation(java.lang.String message, DomainExpression expression, java.lang.Object context) throws InvalidEvaluationException
throwInvalidEvaluation
in interface EvaluationEnvironment
InvalidEvaluationException
public NullValue throwInvalidEvaluation(java.lang.Throwable e, DomainExpression expression, java.lang.Object context, java.lang.String message, java.lang.Object... bindings) throws InvalidEvaluationException
throwInvalidEvaluation
in interface EvaluationEnvironment
InvalidEvaluationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |