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 Summary
Modifier and TypeMethodDescriptionaddInputResolver(String parameterName, org.mule.runtime.api.metadata.resolving.InputTypeResolver resolver) Adds anInputTypeResolverfor a specific input parameteraddInputResolvers(Map<String, org.mule.runtime.api.metadata.resolving.InputTypeResolver> resolvers) InvokesaddInputResolver(String, InputTypeResolver)per each entry inresolversaddRouteChainInputResolver(String routeName, org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver resolver) Adds aChainInputTypeResolverfor a specific route.addRoutePassThroughChainInputResolver(String routeName) Convenience method for configuring a route of which the inner chain will receive the same input type of the router itself.addRoutesChainInputResolvers(Map<String, org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver> resolvers) InvokesaddRouteChainInputResolver(String, ChainInputTypeResolver)per each entry inresolversConvenience 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>Convenience method to configure routers that will output the result of (any) one of its routes.Convenience method to configure a scope that outputs the result of its inner chain.<T extends org.mule.runtime.api.meta.model.declaration.fluent.ComponentDeclaration>
voidconfigure(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration<T> declaration) Applies the configuration onthisinstance on the givendeclaration.<T extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer,D extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration>
voidconfigure(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer<T, D> declarer) Applies the configuration onthisinstance on the givendeclarer.<T extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration>
voidconfigureNullMetadata(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration<T> declaration) Configures the givendeclarationwith resolvers that implement theNull-Objectdesign pattern.<T extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer,D extends org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclaration>
voidconfigureNullMetadata(org.mule.runtime.api.meta.model.declaration.fluent.ParameterizedDeclarer<T, D> declarer) Configures the givendeclarerwith resolvers that implement theNull-Objectdesign pattern.setAttributesTypeResolver(org.mule.runtime.api.metadata.resolving.AttributesTypeResolver attributesTypeResolver) Sets aAttributesTypeResolversetChainInputTypeResolver(org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver chainInputTypeResolver) Sets aChainInputTypeResolver.setConnected(boolean connected) Whether any of the configured resolvers require a connection.setKeysResolver(org.mule.runtime.api.metadata.resolving.TypeKeysResolver keysResolver, String keyParameterName, org.mule.metadata.api.model.MetadataType keyParameterType, boolean isPartialKeyResolver) Sets aTypeKeysResolversetOutputTypeResolver(org.mule.runtime.api.metadata.resolving.OutputTypeResolver outputTypeResolver) Sets anOutputTypeResolverConvenience method to configure a scope of which the inner chain will receive the same input type of the scope itself.
-
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 givendeclarationwith resolvers that implement theNull-Objectdesign 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 givendeclarerwith resolvers that implement theNull-Objectdesign 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 anOutputTypeResolver- Parameters:
outputTypeResolver- the configured resolver- Returns:
thisinstance- Throws:
IllegalArgumentException- ifoutputTypeResolverisnull
-
setAttributesTypeResolver
ComponentMetadataConfigurer setAttributesTypeResolver(org.mule.runtime.api.metadata.resolving.AttributesTypeResolver attributesTypeResolver) Sets aAttributesTypeResolver- Parameters:
attributesTypeResolver- the configured resolver- Returns:
thisinstance- Throws:
IllegalArgumentException- ifattributesTypeResolverisnull
-
setKeysResolver
ComponentMetadataConfigurer setKeysResolver(org.mule.runtime.api.metadata.resolving.TypeKeysResolver keysResolver, String keyParameterName, org.mule.metadata.api.model.MetadataType keyParameterType, boolean isPartialKeyResolver) Sets aTypeKeysResolver- Parameters:
keysResolver- the configured resolverkeyParameterName- the name of the parameter acting as the metadata keykeyParameterType- the type of the parameter referenced by thekeyParameterNameargumentisPartialKeyResolver- whether this resolver is a partial key resolver- Returns:
thisinstance- Throws:
IllegalArgumentException- ifkeysResolverorkeyParameterTypearenull, orkeyParameterNameis blank
-
setChainInputTypeResolver
ComponentMetadataConfigurer setChainInputTypeResolver(org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver chainInputTypeResolver) Sets aChainInputTypeResolver. Only use when configuring a scope component.- Parameters:
chainInputTypeResolver- the configured resolver- Returns:
thisinstance
-
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:
thisinstance
-
addInputResolver
ComponentMetadataConfigurer addInputResolver(String parameterName, org.mule.runtime.api.metadata.resolving.InputTypeResolver resolver) Adds anInputTypeResolverfor a specific input parameter- Parameters:
parameterName- the resolved parameter nameresolver- the configured resolver- Returns:
thisinstance- Throws:
IllegalArgumentException- ifparameterNameis blank orresolverisnull
-
addInputResolvers
ComponentMetadataConfigurer addInputResolvers(Map<String, org.mule.runtime.api.metadata.resolving.InputTypeResolver> resolvers) InvokesaddInputResolver(String, InputTypeResolver)per each entry inresolvers- Parameters:
resolvers- the resolvers to add.- Returns:
thisinstance- Throws:
IllegalArgumentException- under any of the circumstances thataddInputResolver(String, InputTypeResolver)would
-
addRoutePassThroughChainInputResolver
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:
thisinstance- Throws:
IllegalArgumentException- ifrouteNameis blank
-
addRouteChainInputResolver
ComponentMetadataConfigurer addRouteChainInputResolver(String routeName, org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver resolver) Adds aChainInputTypeResolverfor a specific route. Only use when configuring router components- Parameters:
routeName- the route nameresolver- the resolver being set- Returns:
thisinstance- Throws:
IllegalArgumentException- ifrouteNameis blank orresolverisnull
-
addRoutesChainInputResolvers
ComponentMetadataConfigurer addRoutesChainInputResolvers(Map<String, org.mule.sdk.api.metadata.resolving.ChainInputTypeResolver> resolvers) InvokesaddRouteChainInputResolver(String, ChainInputTypeResolver)per each entry inresolvers- Parameters:
resolvers- the resolvers to add.- Returns:
thisinstance- Throws:
IllegalArgumentException- under any of the circumstances thatwould
-
setConnected
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:
thisinstance
-
asOneOfRouter
ComponentMetadataConfigurer 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:
thisinstance
-
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:
thisinstance
-
asAllOfRouter
ComponentMetadataConfigurer 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:
thisinstance
-
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 onthisinstance on the givendeclarer.- 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 onthisinstance on the givendeclaration.- Parameters:
declaration- the target declaration
-