Class AbstractScriptEvaluator
java.lang.Object
com.evolveum.midpoint.model.common.expression.script.AbstractScriptEvaluator
- All Implemented Interfaces:
ScriptEvaluator
- Direct Known Subclasses:
AbstractCachingScriptEvaluator,VelocityScriptEvaluator
Expression evaluator that is using javax.script (JSR-223) engine.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractScriptEvaluator(PrismContext prismContext, Protector protector, LocalizationService localizationService) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean<V extends PrismValue>
@NotNull List<V>evaluate(@NotNull ScriptExpressionEvaluationContext context) Evaluates given script in given context.abstract @Nullable ObjectevaluateInternal(@NotNull String codeString, @NotNull ScriptExpressionEvaluationContext context) Executes the evaluation.protected booleanprotected <T> voidprepareFunctionLibraryMap(ScriptExpressionEvaluationContext context, Map<String, T> map, Function<TypedValue<?>, T> converter) Process functional libraries (name -> implementation) into a map, including a value conversion by lambda.protected <T> voidprepareScriptVariablesMap(ScriptExpressionEvaluationContext context, Map<String, T> map, Function<TypedValue<?>, T> converter) Process variables (name -> TypedValue) into a map, including a value conversion by lambda.protected Map<String,TypedValue<?>> Returns typed variable map: name -> TypedValue, just for the variables.Returns simple variable map: name -> value, including function libraries, contexts and all other objects.protected booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.model.common.expression.script.ScriptEvaluator
getLanguageName, getLanguageUrl, isInitialized
-
Constructor Details
-
AbstractScriptEvaluator
public AbstractScriptEvaluator(PrismContext prismContext, Protector protector, LocalizationService localizationService)
-
-
Method Details
-
getPrismContext
-
getProtector
-
getLocalizationService
-
evaluate
@NotNull public <V extends PrismValue> @NotNull List<V> evaluate(@NotNull @NotNull ScriptExpressionEvaluationContext context) throws ExpressionEvaluationException, ObjectNotFoundException, ExpressionSyntaxException, CommunicationException, ConfigurationException, SecurityViolationException Description copied from interface:ScriptEvaluatorEvaluates given script in given context. Everything is wrapped intoScriptExpressionEvaluationContextobject. -
evaluateInternal
@Nullable public abstract @Nullable Object evaluateInternal(@NotNull @NotNull String codeString, @NotNull @NotNull ScriptExpressionEvaluationContext context) throws Exception Executes the evaluation. Responsible for incrementing respectiveInternalCounters.- Throws:
Exception
-
doesSupportRestrictions
protected boolean doesSupportRestrictions() -
prepareUnifiedScriptVariablesValueMap
protected Map<String,Object> prepareUnifiedScriptVariablesValueMap(ScriptExpressionEvaluationContext context) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException Returns simple variable map: name -> value, including function libraries, contexts and all other objects. -
prepareScriptVariablesTypedValueMap
protected Map<String,TypedValue<?>> prepareScriptVariablesTypedValueMap(ScriptExpressionEvaluationContext context) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException Returns typed variable map: name -> TypedValue, just for the variables. -
prepareFunctionLibraryMap
protected <T> void prepareFunctionLibraryMap(ScriptExpressionEvaluationContext context, Map<String, T> map, Function<TypedValue<?>, throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationExceptionT> converter) Process functional libraries (name -> implementation) into a map, including a value conversion by lambda. -
prepareScriptVariablesMap
protected <T> void prepareScriptVariablesMap(ScriptExpressionEvaluationContext context, Map<String, T> map, Function<TypedValue<?>, throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationExceptionT> converter) Process variables (name -> TypedValue) into a map, including a value conversion by lambda. This method is processing the variables ONLY, it does NOT contain functions and function libraries. -
supportsDeprecatedVariables
protected boolean supportsDeprecatedVariables() -
needsServiceVariables
protected boolean needsServiceVariables()
-