use of org.mule.runtime.module.extension.internal.config.dsl.object.DefaultObjectParsingDelegate in project mule by mulesoft.
the class ExtensionDefinitionParser method parseRoute.
private void parseRoute(NestedRouteModel routeModel) {
DslElementSyntax routeDsl = dslResolver.resolve(routeModel);
Class<?> type = routeModel.getModelProperty(ImplementingTypeModelProperty.class).map(ImplementingTypeModelProperty::getType).orElseThrow(() -> new IllegalStateException("Missing route information"));
MetadataType metadataType = typeLoader.load(type);
addParameter(getChildKey(routeModel.getName()), new DefaultObjectParsingDelegate().parse(routeModel.getName(), (ObjectType) metadataType, routeDsl));
try {
new RouteComponentParser(baseDefinitionBuilder, routeModel, metadataType, getContextClassLoader(), routeDsl, dslResolver, parsingContext).parse().forEach(this::addDefinition);
} catch (Exception e) {
throw new MuleRuntimeException(new ConfigurationException(e));
}
}
use of org.mule.runtime.module.extension.internal.config.dsl.object.DefaultObjectParsingDelegate 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);
}
}
Aggregations