Class ComponentConfiguration.Builder

java.lang.Object
org.mule.runtime.dsl.api.component.config.ComponentConfiguration.Builder
Enclosing class:
ComponentConfiguration

public static class ComponentConfiguration.Builder extends Object
Builder for creating ComponentConfiguration instances.
  • Method Details

    • getComponentConfiguration

      public ComponentConfiguration getComponentConfiguration()
      Returns:
      the location of the component in the configuration.
    • withIdentifier

      public ComponentConfiguration.Builder withIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier)
      Parameters:
      identifier - identifier for the configuration element this object represents.
      Returns:
      the builder.
    • withParameter

      public ComponentConfiguration.Builder withParameter(String name, String value)
      Adds a configuration parameter to the component
      Parameters:
      name - configuration attribute name
      value - configuration attribute value
      Returns:
      the builder
    • withValue

      public ComponentConfiguration.Builder withValue(String textContent)
      Sets the inner content of the configuration element.
      Parameters:
      textContent - inner text content from the configuration
      Returns:
      the builder
    • withProperty

      public ComponentConfiguration.Builder withProperty(String name, Object value)
      Adds a property to the ComponentConfiguration. This property is meant to hold only metadata of the configuration.
      Parameters:
      name - custom attribute name.
      value - custom attribute value.
      Returns:
      the builder.
    • withComponentLocation

      public ComponentConfiguration.Builder withComponentLocation(org.mule.runtime.api.component.location.ComponentLocation componentLocation)
      Parameters:
      componentLocation - the location of the component in the configuration.
      Returns:
      the builder.
    • withNestedComponent

      public ComponentConfiguration.Builder withNestedComponent(ComponentConfiguration nestedComponent)
      Adds a complex configuration parameter to the component.

      For instance, to define a file:matcher for a file:read component: *

       
       <file:read>
         <file:matcher regex="XYZ"/>
       </file:read>
       
       
      Parameters:
      nestedComponent - the ComponentConfiguration that represents the nested configuration
      Returns:
      this ComponentConfiguration.Builder
    • build

      public ComponentConfiguration build()
      Returns:
      a ComponentConfiguration with the provided configuration