org.eclipse.ocl.examples.pivot.options
Class EvaluationOptions

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.options.EvaluationOptions

public class EvaluationOptions
extends java.lang.Object

Options applicable to EvaluationEnvironments to customize their evaluation behaviour.

Author:
Christian W. Damus (cdamus)

Field Summary
static Option<java.lang.Boolean> LAX_NULL_HANDLING
           Evaluation option indicating whether to implement lax handling of null values in certain OclAny-defined operations.
 
Method Summary
static
<T> T
getValue(EvaluationEnvironment env, Option<T> option)
          Obtains the value of the specified option's setting in the the given environment's options map, adapting the environment as necessary to the Customizable API.
static
<T> void
setOption(EvaluationEnvironment env, Option<T> option, T value)
          Add an option to apply to the specified environment, adapting it as necessary to the Customizable API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAX_NULL_HANDLING

@NonNull
public static final Option<java.lang.Boolean> LAX_NULL_HANDLING

Evaluation option indicating whether to implement lax handling of null values in certain OclAny-defined operations. When true, the null.oclIsKindOf(OclType) and null.oclIsTypeOf(OclType) operations will return true for any OCL type instead of returning OclInvalid, as OclVoid is defined as conforming to all other types. Similarly, null.oclAsType(OclType) will return null for any OCL type instead of OclInvalid as prescribed by the OCL 2.0 Specification.

For backward compatibility with the 1.1 release behaviour, the default value of this option is true. For strict conformance to the specification, use false.

Method Detail

setOption

public static <T> void setOption(@NonNull
                                 EvaluationEnvironment env,
                                 @NonNull
                                 Option<T> option,
                                 @Nullable
                                 T value)
Add an option to apply to the specified environment, adapting it as necessary to the Customizable API.

Parameters:
env - an evaluation environment on which to set an option
option - the option
value - the option's value
See Also:
Cusotmizable#setOption(Option, Object)

getValue

@Nullable
public static <T> T getValue(@NonNull
                                      EvaluationEnvironment env,
                                      @NonNull
                                      Option<T> option)
Obtains the value of the specified option's setting in the the given environment's options map, adapting the environment as necessary to the Customizable API. If not already set, return the option's default value.

Parameters:
env - an evaluation environment on which to query an option
option - an option to query
Returns:
value of the option
See Also:
Customizable.getValue(Option)