Search in sources :

Example 1 with TypedInlineParameterGroupParser

use of org.mule.runtime.module.extension.internal.config.dsl.parameter.TypedInlineParameterGroupParser in project mule by mulesoft.

the class ExtensionDefinitionParser method parseInlineParameterGroup.

protected void parseInlineParameterGroup(ParameterGroupModel group) throws ConfigurationException {
    ParameterGroupDescriptor descriptor = group.getModelProperty(ParameterGroupModelProperty.class).map(ParameterGroupModelProperty::getDescriptor).orElse(null);
    DslElementSyntax dslElementSyntax = dslResolver.resolveInline(group);
    if (descriptor != null) {
        addParameter(getChildKey(getContainerName(descriptor.getContainer())), new DefaultObjectParsingDelegate().parse("", null, dslElementSyntax));
        new TypedInlineParameterGroupParser(baseDefinitionBuilder, group, descriptor, getContextClassLoader(), dslElementSyntax, dslResolver, parsingContext).parse().forEach(this::addDefinition);
    } else {
        AttributeDefinition.Builder builder = fromChildConfiguration(Map.class);
        if (dslElementSyntax.isWrapped()) {
            builder.withWrapperIdentifier(dslElementSyntax.getElementName());
        } else {
            builder.withIdentifier(dslElementSyntax.getElementName());
        }
        addParameter(getChildKey(group.getName()), builder);
        new AnonymousInlineParameterGroupParser(baseDefinitionBuilder, group, getContextClassLoader(), dslElementSyntax, dslResolver, parsingContext).parse().forEach(this::addDefinition);
    }
}
Also used : TypedInlineParameterGroupParser(org.mule.runtime.module.extension.internal.config.dsl.parameter.TypedInlineParameterGroupParser) ParameterGroupDescriptor(org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor) DslElementSyntax(org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax) DefaultObjectParsingDelegate(org.mule.runtime.module.extension.internal.config.dsl.object.DefaultObjectParsingDelegate) AttributeDefinition(org.mule.runtime.dsl.api.component.AttributeDefinition) AnonymousInlineParameterGroupParser(org.mule.runtime.module.extension.internal.config.dsl.parameter.AnonymousInlineParameterGroupParser)

Aggregations

AttributeDefinition (org.mule.runtime.dsl.api.component.AttributeDefinition)1 DslElementSyntax (org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax)1 DefaultObjectParsingDelegate (org.mule.runtime.module.extension.internal.config.dsl.object.DefaultObjectParsingDelegate)1 AnonymousInlineParameterGroupParser (org.mule.runtime.module.extension.internal.config.dsl.parameter.AnonymousInlineParameterGroupParser)1 TypedInlineParameterGroupParser (org.mule.runtime.module.extension.internal.config.dsl.parameter.TypedInlineParameterGroupParser)1 ParameterGroupDescriptor (org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor)1