use of org.mule.runtime.config.api.dsl.model.DslElementModel in project mule by mulesoft.
the class DeclarationBasedElementModelFactory method addInlineGroupElement.
private <T> void addInlineGroupElement(ParameterGroupModel group, DslElementSyntax elementDsl, InternalComponentConfiguration.Builder parentConfig, DslElementModel.Builder<T> parentElement, Optional<ParameterGroupElementDeclaration> declaration) {
elementDsl.getChild(group.getName()).ifPresent(groupDsl -> {
DslElementModel.Builder<ParameterGroupModel> groupElementBuilder = DslElementModel.<ParameterGroupModel>builder().withModel(group).withDsl(groupDsl).isExplicitInDsl(declaration.isPresent());
InternalComponentConfiguration.Builder groupConfigBuilder = InternalComponentConfiguration.builder().withIdentifier(asIdentifier(groupDsl));
addGroupParameterElements(group, groupDsl, groupConfigBuilder, groupElementBuilder, declaration);
ComponentConfiguration groupConfig = groupConfigBuilder.build();
groupElementBuilder.withConfig(groupConfig);
parentConfig.withNestedComponent(groupConfig);
parentElement.containing(groupElementBuilder.build());
});
}
use of org.mule.runtime.config.api.dsl.model.DslElementModel in project mule by mulesoft.
the class DeclarationBasedElementModelFactory method createConfigurationElement.
private DslElementModel<ConfigurationModel> createConfigurationElement(ConfigurationModel model, ConfigurationElementDeclaration configDeclaration) {
DslElementSyntax configDsl = dsl.resolve(model);
InternalComponentConfiguration.Builder configuration = InternalComponentConfiguration.builder().withIdentifier(asIdentifier(configDsl)).withParameter(NAME_ATTRIBUTE_NAME, configDeclaration.getRefName());
DslElementModel.Builder<ConfigurationModel> element = createParameterizedElementModel(model, configDsl, configDeclaration, configuration);
configDeclaration.getConnection().ifPresent(connection -> addConnectionProvider(connection, model, configuration, element));
return element.withConfig(configuration.build()).build();
}
Aggregations