Search in sources :

Example 1 with ComputedExpression

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);
    }
}
Also used : DslDefinition(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition) ComputedExpression(io.vertigo.dynamo.domain.metamodel.ComputedExpression) Domain(io.vertigo.dynamo.domain.metamodel.Domain)

Aggregations

ComputedExpression (io.vertigo.dynamo.domain.metamodel.ComputedExpression)1 Domain (io.vertigo.dynamo.domain.metamodel.Domain)1 DslDefinition (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition)1