use of com.evolveum.midpoint.prism.xnode.XNodeFactory in project midpoint by Evolveum.
the class TestJaxbConstruction method createFilter.
private MapXNode createFilter() {
XNodeFactory factory = getPrismContext().xnodeFactory();
Map<QName, XNode> equalsElementSource = new HashMap<>();
PrimitiveXNode<ItemPathType> pathElement = factory.primitive(new ItemPathType(new ItemName("name")));
equalsElementSource.put(new QName(SchemaConstantsGenerated.NS_QUERY, "path"), pathElement);
PrimitiveXNode<String> valueElement = factory.primitive("čučoriedka");
equalsElementSource.put(new QName(SchemaConstantsGenerated.NS_QUERY, "value"), valueElement);
MapXNode equalsElement = factory.map(equalsElementSource);
return factory.map(new QName(SchemaConstantsGenerated.NS_QUERY, "equal"), equalsElement);
}
use of com.evolveum.midpoint.prism.xnode.XNodeFactory in project midpoint by Evolveum.
the class ScriptExecutor method replaceScriptArgumentWithComputedValues.
private void replaceScriptArgumentWithComputedValues(ProvisioningScriptArgumentType argument, Collection<PrismPropertyValue<String>> values) {
argument.getExpressionEvaluator().clear();
if (values.isEmpty()) {
// We need to create at least one evaluator. Otherwise the expression code will complain
JAXBElement<RawType> el = new JAXBElement<>(SchemaConstants.C_VALUE, RawType.class, new RawType(b.prismContext));
argument.getExpressionEvaluator().add(el);
} else {
for (PrismPropertyValue<String> val : values) {
XNodeFactory factory = b.prismContext.xnodeFactory();
PrimitiveXNode<String> prim = factory.primitive(val.getValue(), DOMUtil.XSD_STRING);
JAXBElement<RawType> el = new JAXBElement<>(SchemaConstants.C_VALUE, RawType.class, new RawType(prim.frozen(), b.prismContext));
argument.getExpressionEvaluator().add(el);
}
}
}
Aggregations