Interface ComponentAstBuilder

All Superinterfaces:
Supplier<ComponentAst>
All Known Implementing Classes:
BaseComponentAstBuilder, DefaultComponentAstBuilder, LightComponentAstBuilder

@NoImplement public interface ComponentAstBuilder extends Supplier<ComponentAst>
Provides a way of creating ComponentAst instances, configuring it and any children it may have.
Since:
1.0
  • Method Details

    • builder

      static ComponentAstBuilder builder()
      Provides a builder for ComponentAst that does not belong to an ArtifactAst.
      Returns:
      a fresh ComponentAstBuilder instance.
    • 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

      ComponentAstBuilder withRawParameter(String paramName, String paramRawValue)
      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 by withParameterizedModel(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

      ComponentAstBuilder withBodyParameter(String parameterRawValue)
      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 by withParameterizedModel(ParameterizedModel) to create the actual parameters map of the component.

      Parameters:
      parameterRawValue - the raw value of the body parameter.
      Returns:
      this builder
    • withAnnotation

      ComponentAstBuilder withAnnotation(String name, Object value)
      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

      ComponentAstBuilder withMetadata(ComponentMetadataAst metadata)
      Parameters:
      metadata - the parser metadata for this component.
      Returns:
      this builder
    • withIdentifier

      ComponentAstBuilder withIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier)
      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

      <M> Optional<M> getModel(Class<M> modelClass)
      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 of ConfigurationModel, ComponentModel or ConnectionProviderModel (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