Package org.mule.runtime.ast.api.builder
Interface ComponentAstBuilder
- All Superinterfaces:
Supplier<ComponentAst>
- All Known Implementing Classes:
BaseComponentAstBuilder,DefaultComponentAstBuilder,LightComponentAstBuilder
Provides a way of creating
ComponentAst instances, configuring it and any children it may have.- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionAdds a child component to the component being built with this builder.build()Builds the target component and its children.static ComponentAstBuilderbuilder()Provides a builder forComponentAstthat does not belong to anArtifactAst.org.mule.runtime.api.meta.model.ExtensionModelorg.mule.runtime.api.component.ComponentIdentifier<M> Optional<M>A component may be represented by different kinds of models, depending on the actual type of this component.withAnnotation(String name, Object value) Adds an annotation as defined in the DSL to this component builder.withBodyParameter(String parameterRawValue) Adds a body parameter as defined in the DSL to this component builder.withIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier) withMetadata(ComponentMetadataAst metadata) withParameterizedModel(org.mule.runtime.api.meta.model.parameter.ParameterizedModel parameterizedModel) Sets the model declaration of the target component.withRawParameter(String paramName, String paramRawValue) Adds a parameter as defined in the DSL to this component builder.
-
Method Details
-
builder
Provides a builder forComponentAstthat does not belong to anArtifactAst.- Returns:
- a fresh
ComponentAstBuilderinstance.
-
addChildComponent
ComponentAstBuilder addChildComponent()Adds a child component to the component being built with this builder.- Returns:
- the builder for the newly added child component
-
withRawParameter
Adds a parameter as defined in the DSL to this component builder.When the target component is actually being
built, these parameter names are matched to the parameters defined in the model provided bywithParameterizedModel(ParameterizedModel)to create the actual parameters map of the component.- Parameters:
paramName- the name of the parameter for which a raw value is provided.paramRawValue- the raw value of the parameter, as defined in the DSL.- Returns:
- this builder
-
withBodyParameter
Adds a body parameter as defined in the DSL to this component builder.When the target component is actually being
built, these body parameter is matched to the parameters defined in the model provided bywithParameterizedModel(ParameterizedModel)to create the actual parameters map of the component.- Parameters:
parameterRawValue- the raw value of the body parameter.- Returns:
- this builder
-
withAnnotation
Adds an annotation as defined in the DSL to this component builder.- Parameters:
qName- the qualified name of the annotation to be added.value- the value of the annotation.- Returns:
- this builder
-
withMetadata
- Parameters:
metadata- the parser metadata for this component.- Returns:
- this builder
-
withIdentifier
- Parameters:
identifier- the identifier for the configuration element this object represents.- Returns:
- this builder
-
withParameterizedModel
ComponentAstBuilder withParameterizedModel(org.mule.runtime.api.meta.model.parameter.ParameterizedModel parameterizedModel) Sets the model declaration of the target component.This method is exclusive with
#withComponentModel(ComponentModel),#withNestableElementModel(NestableElementModel),#withConfigurationModel(ConfigurationModel)and#withConnectionProviderModel(ConnectionProviderModel); only one of these may be called for a single builder.- Parameters:
parameterizedModel- the model that represents this component.- Returns:
- this builder
-
getExtensionModel
org.mule.runtime.api.meta.model.ExtensionModel getExtensionModel()- Returns:
- the extension model that declares the model this component represents.
- Since:
- 1.5
-
getModel
A component may be represented by different kinds of models, depending on the actual type of this component. Possible values may be, for instance, instances ofConfigurationModel,ComponentModelorConnectionProviderModel(but not necessarily limited to those).- Parameters:
modelClass- the class of the model this method should return.- Returns:
- the model that represents this component.
- Since:
- 1.5
-
getIdentifier
org.mule.runtime.api.component.ComponentIdentifier getIdentifier()- Returns:
- the identifier for the configuration element this object represents.
- Since:
- 1.5
-
build
ComponentAst build()Builds the target component and its children.- Returns:
- the target component
-