Class GroovyScriptEvaluator
java.lang.Object
com.evolveum.midpoint.model.common.expression.script.AbstractScriptEvaluator
com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator<groovy.lang.GroovyClassLoader,Class<?>>
com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator
- All Implemented Interfaces:
ScriptEvaluator
public class GroovyScriptEvaluator
extends AbstractCachingScriptEvaluator<groovy.lang.GroovyClassLoader,Class<?>>
Expression evaluator that is using Groovy scripting engine.
"Sandboxing" based on type checking inspired by work of Cédric Champeau (http://melix.github.io/blog/2015/03/sandboxing.html)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGroovyScriptEvaluator
(PrismContext prismContext, Protector protector, LocalizationService localizationService) Called by Spring but also by lower-level tests -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>
compileScript
(String codeString, ScriptExpressionEvaluationContext context) protected boolean
protected Object
evaluateScript
(Class<?> compiledScriptClass, ScriptExpressionEvaluationContext context) Returns human readable name of the language that this evaluator supports@NotNull String
Returns (canonical) URL of the language that this evaluator can handleMethods inherited from class com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator
evaluateInternal, getScriptCache
Methods inherited from class com.evolveum.midpoint.model.common.expression.script.AbstractScriptEvaluator
evaluate, getLocalizationService, getPrismContext, getProtector, prepareScriptVariablesValueMap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.model.common.expression.script.ScriptEvaluator
isInitialized
-
Field Details
-
LANGUAGE_NAME
- See Also:
-
-
Constructor Details
-
GroovyScriptEvaluator
public GroovyScriptEvaluator(PrismContext prismContext, Protector protector, LocalizationService localizationService) Called by Spring but also by lower-level tests
-
-
Method Details
-
getLanguageName
Description copied from interface:ScriptEvaluator
Returns human readable name of the language that this evaluator supports -
getLanguageUrl
Description copied from interface:ScriptEvaluator
Returns (canonical) URL of the language that this evaluator can handle -
doesSupportRestrictions
protected boolean doesSupportRestrictions()- Overrides:
doesSupportRestrictions
in classAbstractScriptEvaluator
-
compileScript
protected Class<?> compileScript(String codeString, ScriptExpressionEvaluationContext context) throws ExpressionEvaluationException, SecurityViolationException - Specified by:
compileScript
in classAbstractCachingScriptEvaluator<groovy.lang.GroovyClassLoader,
Class<?>> - Throws:
ExpressionEvaluationException
SecurityViolationException
-
evaluateScript
protected Object evaluateScript(Class<?> compiledScriptClass, ScriptExpressionEvaluationContext context) throws Exception - Specified by:
evaluateScript
in classAbstractCachingScriptEvaluator<groovy.lang.GroovyClassLoader,
Class<?>> - Throws:
Exception
-