use of com.evolveum.midpoint.prism.ExpressionWrapper in project midpoint by Evolveum.
the class PrismQueryExpressionSupport method parseScript.
@Override
public ExpressionWrapper parseScript(Map<String, String> namespaceContext, String language, String script) {
ExpressionType expressionT = new ExpressionType();
var scriptValue = new ScriptExpressionEvaluatorType();
if (!Strings.isNullOrEmpty(language)) {
scriptValue.setLanguage(language);
}
scriptValue.setCode(script);
expressionT.expressionEvaluator(new JAXBElement<>(SCRIPT, ScriptExpressionEvaluatorType.class, scriptValue));
return new ExpressionWrapper(EXPRESSION, expressionT);
}
use of com.evolveum.midpoint.prism.ExpressionWrapper in project midpoint by Evolveum.
the class AbstractIntegrationTest method assertExpression.
protected <T> void assertExpression(PrismProperty<T> prop, String evaluatorName) {
PrismPropertyValue<T> pval = prop.getValue();
ExpressionWrapper expressionWrapper = pval.getExpression();
assertNotNull("No expression wrapper in " + prop, expressionWrapper);
Object expressionObj = expressionWrapper.getExpression();
assertNotNull("No expression in " + prop, expressionObj);
assertTrue("Wrong expression type: " + expressionObj.getClass(), expressionObj instanceof ExpressionType);
ExpressionType expressionType = (ExpressionType) expressionObj;
JAXBElement<?> evaluatorElement = expressionType.getExpressionEvaluator().iterator().next();
assertEquals("Wrong expression evaluator name", evaluatorName, evaluatorElement.getName().getLocalPart());
}
Aggregations