Interface ComponentMetadataConfigurer


@Experimental @NoImplement public interface ComponentMetadataConfigurer
Declarative API for configuring DataSense related resolvers at the declarer or declaration level with minimal exposure to the implementation details. NOTE: Experimental feature. Backwards compatibility is not guaranteed.
Since:
1.8
  • Method Details

    • configureNullMetadata

      <T extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration> void configureNullMetadata(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration<T> declaration)
      Configures the given declaration with resolvers that implement the Null-Object design pattern. That is, the declaration will get enriched with resolver instances that yield default (non necessarily useful) values.
      Parameters:
      declaration - a component's declaration object
    • configureNullMetadata

      <T extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer, D extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration> void configureNullMetadata(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer<T,D> declarer)
      Configures the given declarer with resolvers that implement the Null-Object design pattern. That is, the declaration will get enriched with resolver instances that yield default (non necessarily useful) values.
      Parameters:
      declarer - a component's declarer object
    • setOutputTypeResolver

      ComponentMetadataConfigurer setOutputTypeResolver(org.mule.runtime.api.metadata.resolving.OutputTypeResolver outputTypeResolver)
      Sets an OutputTypeResolver
      Parameters:
      outputTypeResolver - the configured resolver
      Returns:
      this instance
      Throws:
      IllegalArgumentException - if outputTypeResolver is null
    • setAttributesTypeResolver

      ComponentMetadataConfigurer setAttributesTypeResolver(org.mule.runtime.api.metadata.resolving.AttributesTypeResolver attributesTypeResolver)
      Sets a AttributesTypeResolver
      Parameters:
      attributesTypeResolver - the configured resolver
      Returns:
      this instance
      Throws:
      IllegalArgumentException - if attributesTypeResolver is null
    • setKeysResolver

      ComponentMetadataConfigurer setKeysResolver(org.mule.runtime.api.metadata.resolving.TypeKeysResolver keysResolver, String keyParameterName, org.mule.metadata.api.model.MetadataType keyParameterType, boolean isPartialKeyResolver)
      Sets a TypeKeysResolver
      Parameters:
      keysResolver - the configured resolver
      keyParameterName - the name of the parameter acting as the metadata key
      keyParameterType - the type of the parameter referenced by the keyParameterName argument
      isPartialKeyResolver - whether this resolver is a partial key resolver
      Returns:
      this instance
      Throws:
      IllegalArgumentException - if keysResolver or keyParameterType are null, or keyParameterName is blank
    • setChainInputTypeResolver

      ComponentMetadataConfigurer setChainInputTypeResolver(org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver chainInputTypeResolver)
      Sets a ChainInputTypeResolver. Only use when configuring a scope component.
      Parameters:
      chainInputTypeResolver - the configured resolver
      Returns:
      this instance
    • withPassThroughChainInputTypeResolver

      ComponentMetadataConfigurer withPassThroughChainInputTypeResolver()
      Convenience method to configure a scope of which the inner chain will receive the same input type of the scope itself. An example of such a scope would be <async>.
      Returns:
      this instance
    • addInputResolver

      ComponentMetadataConfigurer addInputResolver(String parameterName, org.mule.runtime.api.metadata.resolving.InputTypeResolver resolver)
      Adds an InputTypeResolver for a specific input parameter
      Parameters:
      parameterName - the resolved parameter name
      resolver - the configured resolver
      Returns:
      this instance
      Throws:
      IllegalArgumentException - if parameterName is blank or resolver is null
    • addInputResolvers

      ComponentMetadataConfigurer addInputResolvers(Map<String,org.mule.runtime.api.metadata.resolving.InputTypeResolver> resolvers)
      Invokes addInputResolver(String, InputTypeResolver) per each entry in resolvers
      Parameters:
      resolvers - the resolvers to add.
      Returns:
      this instance
      Throws:
      IllegalArgumentException - under any of the circumstances that addInputResolver(String, InputTypeResolver) would
    • addRoutePassThroughChainInputResolver

      ComponentMetadataConfigurer addRoutePassThroughChainInputResolver(String routeName)
      Convenience method for configuring a route of which the inner chain will receive the same input type of the router itself.

      Only use when configuring router components.

      Parameters:
      routeName - the route name
      Returns:
      this instance
      Throws:
      IllegalArgumentException - if routeName is blank
    • addRouteChainInputResolver

      ComponentMetadataConfigurer addRouteChainInputResolver(String routeName, org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver resolver)
      Adds a ChainInputTypeResolver for a specific route. Only use when configuring router components
      Parameters:
      routeName - the route name
      resolver - the resolver being set
      Returns:
      this instance
      Throws:
      IllegalArgumentException - if routeName is blank or resolver is null
    • addRoutesChainInputResolvers

      ComponentMetadataConfigurer addRoutesChainInputResolvers(Map<String,org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver> resolvers)
      Parameters:
      resolvers - the resolvers to add.
      Returns:
      this instance
      Throws:
      IllegalArgumentException - under any of the circumstances that would
    • setConnected

      ComponentMetadataConfigurer setConnected(boolean connected)
      Whether any of the configured resolvers require a connection. If not invoked, all resolvers will be assumed to not require it.
      Parameters:
      connected - whether any of the configured resolvers require a connection
      Returns:
      this instance
    • asOneOfRouter

      Convenience method to configure routers that will output the result of (any) one of its routes. An example of such a router would be <first-successful>
      Returns:
      this instance
    • asPassthroughScope

      ComponentMetadataConfigurer asPassthroughScope()
      Convenience method to configure a scope that outputs the result of its inner chain. An example of such a scope would be <try>
      Returns:
      this instance
    • asAllOfRouter

      Convenience method to configure routers that return the sum of all its routes, in the form of an object which attributes matches the route names (e.g: <scatter-gather>
      Returns:
      this instance
    • configure

      <T extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer, D extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration> void configure(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer<T,D> declarer)
      Applies the configuration on this instance on the given declarer.
      Parameters:
      declarer - the target declarer
    • configure

      <T extends org.mule.runtime.api.meta.model.declaration.fluent.ComponentDeclaration> void configure(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration<T> declaration)
      Applies the configuration on this instance on the given declaration.
      Parameters:
      declaration - the target declaration