Package com.nomagic.magicdraw.evaluation
Class EvaluationConfigurator
- java.lang.Object
-
- com.nomagic.magicdraw.evaluation.EvaluationConfigurator
-
@OpenApiAll public class EvaluationConfigurator extends java.lang.Object
This is an open api class for accessing opaque expression evaluators (for further configuring purposes).- See Also:
Evaluator
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EvaluationConfigurator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>
getAvailableLanguages()
Enumerates available evaluatable languages for opaque expressions Currently (as of v12.5) 2 languages are supported - "Binary" and "OCL2.0"Evaluator
getEvaluatorForLanguage(java.lang.String lang)
Retrieves the appropriate evaluator, which knows how to evaluate expressions of the given languagestatic EvaluationConfigurator
getInstance()
Retrieves configurator singletonvoid
registerBinaryImplementers(java.lang.ClassLoader cl)
Method allows registering additional class loaders, to load classes, implementing binary expressions.void
registerEvaluator(java.lang.String language, Evaluator evaluator)
Registers evaluator for the specified language.void
unregisterEvaluator(java.lang.String language)
Unregisters evaluator for the specified language.
-
-
-
Method Detail
-
getInstance
public static EvaluationConfigurator getInstance()
Retrieves configurator singleton- Returns:
- configurator singleton
-
getAvailableLanguages
public java.util.Set<java.lang.String> getAvailableLanguages()
Enumerates available evaluatable languages for opaque expressions Currently (as of v12.5) 2 languages are supported - "Binary" and "OCL2.0"- Returns:
- set of the available languages (strings)
-
getEvaluatorForLanguage
public Evaluator getEvaluatorForLanguage(java.lang.String lang)
Retrieves the appropriate evaluator, which knows how to evaluate expressions of the given language- Parameters:
lang
- one of the evaluatable languages- Returns:
- evaluator object, suitable for expression evaluation or null if language is not evaluatable
- See Also:
Evaluator
-
registerBinaryImplementers
public void registerBinaryImplementers(java.lang.ClassLoader cl)
Method allows registering additional class loaders, to load classes, implementing binary expressions. This is especially necessary for expression implementations, coming from plugins (otherwise these implementation classes will not be found - since they are in a separate class loader - plugin class loader).- Parameters:
cl
- class loader, supplying additional classes, implementing expressions
-
registerEvaluator
public void registerEvaluator(java.lang.String language, Evaluator evaluator)
Registers evaluator for the specified language.- Parameters:
language
- language identifier.evaluator
- an evaluator object.
-
unregisterEvaluator
public void unregisterEvaluator(java.lang.String language)
Unregisters evaluator for the specified language.- Parameters:
language
- language identifier.
-
-