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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGroovyScriptEvaluator(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 booleanprotected ObjectevaluateScript(Class<?> compiledScriptClass, ScriptExpressionEvaluationContext context) Returns human readable name of the language that this evaluator supports@NotNull StringReturns (canonical) URL of the language that this evaluator can handleMethods inherited from class com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator
evaluateInternal, getScriptCacheMethods inherited from class com.evolveum.midpoint.model.common.expression.script.AbstractScriptEvaluator
evaluate, getLocalizationService, getPrismContext, getProtector, prepareScriptVariablesValueMapMethods 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
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:ScriptEvaluatorReturns human readable name of the language that this evaluator supports -
getLanguageUrl
Description copied from interface:ScriptEvaluatorReturns (canonical) URL of the language that this evaluator can handle -
doesSupportRestrictions
protected boolean doesSupportRestrictions()- Overrides:
doesSupportRestrictionsin classAbstractScriptEvaluator
-
compileScript
protected Class<?> compileScript(String codeString, ScriptExpressionEvaluationContext context) throws ExpressionEvaluationException, SecurityViolationException - Specified by:
compileScriptin classAbstractCachingScriptEvaluator<groovy.lang.GroovyClassLoader,Class<?>> - Throws:
ExpressionEvaluationExceptionSecurityViolationException
-
evaluateScript
protected Object evaluateScript(Class<?> compiledScriptClass, ScriptExpressionEvaluationContext context) throws Exception - Specified by:
evaluateScriptin classAbstractCachingScriptEvaluator<groovy.lang.GroovyClassLoader,Class<?>> - Throws:
Exception
-