public abstract class ExecutorManager extends java.lang.Object implements Evaluator
Modifier and Type | Field and Description |
---|---|
protected CompleteEnvironment |
environment |
protected StandardLibrary |
standardLibrary |
Constructor and Description |
---|
ExecutorManager(CompleteEnvironment environment) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.util.regex.Pattern> |
createRegexCache()
Creates (on demand) the regular-expression matcher cache.
|
void |
dispose() |
Value |
evaluate(OCLExpression body) |
Value |
evaluateIteration(Type returnType,
CollectionValue sourceVal,
TypedElement accumulator,
OCLExpression body,
TypedElement[] iterators) |
CompleteEnvironment |
getCompleteEnvironment() |
int |
getDiagnosticSeverity(int severityPreference,
java.lang.Object resultValue)
Return the org.eclipse.emf.common.util.Diagnostic severity to be reported for a non-true
validation resultValue given a severityPreference defined by a StatusCodes value.
|
Type |
getDynamicTypeOf(java.lang.Object value) |
EvaluationEnvironment |
getEvaluationEnvironment() |
EvaluationLogger |
getLogger()
Return the logger handling oclLog() invocations or null for none.
|
java.util.regex.Pattern |
getRegexPattern(java.lang.String regex)
Return a cached matcher for a give regular expression.
|
int |
getSeverity(java.lang.Object validationKey)
Return the StatusCodes severity with which the validation identified by validationKey is reported.
|
StandardLibrary |
getStandardLibrary() |
Class |
getStaticTypeOf(java.lang.Object value) |
Class |
getStaticTypeOf(java.lang.Object value,
java.lang.Iterable<?> values) |
Class |
getStaticTypeOf(java.lang.Object value,
java.lang.Object... values) |
boolean |
isCanceled()
Return true if the evaluation has been canceled.
|
void |
setCanceled(boolean isCanceled)
Request cancelation of the current the evaluation, or reset the request for a new evaluation.
|
void |
setLogger(EvaluationLogger logger)
Specify the logger to handle oclLog() invocations or null for none.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createNestedEvaluator, getIdResolver, getModelManager
@NonNull protected final CompleteEnvironment environment
@NonNull protected final StandardLibrary standardLibrary
public ExecutorManager(@NonNull CompleteEnvironment environment)
@NonNull protected java.util.Map<java.lang.String,java.util.regex.Pattern> createRegexCache()
getRegexPattern(String)
@NonNull public Value evaluate(@NonNull OCLExpression body)
public Value evaluateIteration(Type returnType, CollectionValue sourceVal, TypedElement accumulator, OCLExpression body, TypedElement[] iterators)
@NonNull public CompleteEnvironment getCompleteEnvironment()
getCompleteEnvironment
in interface Evaluator
public int getDiagnosticSeverity(int severityPreference, @Nullable java.lang.Object resultValue)
Evaluator
getDiagnosticSeverity
in interface Evaluator
@NonNull public EvaluationEnvironment getEvaluationEnvironment()
getEvaluationEnvironment
in interface Evaluator
@Nullable public EvaluationLogger getLogger()
Evaluator
@NonNull public java.util.regex.Pattern getRegexPattern(@NonNull java.lang.String regex)
getRegexPattern
in interface Evaluator
public int getSeverity(@Nullable java.lang.Object validationKey)
Evaluator
StatusCodes.OK severity suppresses the validation altogether.
StatusCodes.Warning is returned for any null or unknown key.
getSeverity
in interface Evaluator
@NonNull public StandardLibrary getStandardLibrary()
getStandardLibrary
in interface Evaluator
@NonNull public Class getStaticTypeOf(@Nullable java.lang.Object value)
getStaticTypeOf
in interface Evaluator
@NonNull public Class getStaticTypeOf(@Nullable java.lang.Object value, @NonNull java.lang.Object... values)
getStaticTypeOf
in interface Evaluator
@NonNull public Class getStaticTypeOf(@Nullable java.lang.Object value, @NonNull java.lang.Iterable<?> values)
getStaticTypeOf
in interface Evaluator
public boolean isCanceled()
Evaluator
isCanceled
in interface Evaluator
public void setCanceled(boolean isCanceled)
Evaluator
EvaluationHaltedException
when an expression,
operation or iteration is next invoked.setCanceled
in interface Evaluator
public void setLogger(@Nullable EvaluationLogger logger)
Evaluator