use of io.vertigo.dynamo.domain.metamodel.ComputedExpression in project vertigo by KleeGroup.
the class DomainDynamicRegistry method populateComputedDtField.
/**
* Ajoute une liste de champs d'un certain type à la dtDefinition
*
* @param fields List
*/
private static void populateComputedDtField(final DefinitionSpace definitionSpace, final DtDefinitionBuilder dtDefinitionBuilder, final List<DslDefinition> fields) {
for (final DslDefinition field : fields) {
final Domain domain = definitionSpace.resolve(field.getDefinitionLinkName("domain"), Domain.class);
// --
Assertion.checkArgument(field.getPropertyNames().contains(KspProperty.LABEL), "Label est une propriété obligatoire");
final String label = (String) field.getPropertyValue(KspProperty.LABEL);
// ---
final String expression = (String) field.getPropertyValue(KspProperty.EXPRESSION);
final ComputedExpression computedExpression = new ComputedExpression(expression);
// --
final String fieldName = field.getName();
dtDefinitionBuilder.addComputedField(fieldName, label, domain, computedExpression);
}
}
Aggregations