Class ShellMethodArgumentResolverComposite

java.lang.Object
org.springframework.shell.command.invocation.ShellMethodArgumentResolverComposite
All Implemented Interfaces:
org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver

public class ShellMethodArgumentResolverComposite extends Object implements org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
Resolves method parameters by delegating to a list of registered HandlerMethodArgumentResolvers. Previously resolved method parameters are cached for faster lookups.
  • Constructor Details

    • ShellMethodArgumentResolverComposite

      public ShellMethodArgumentResolverComposite()
  • Method Details

    • addResolver

      public ShellMethodArgumentResolverComposite addResolver(org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver resolver)
      Add the given HandlerMethodArgumentResolver.
    • addResolvers

      public ShellMethodArgumentResolverComposite addResolvers(@Nullable org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver... resolvers)
      Add the given HandlerMethodArgumentResolvers.
      Since:
      4.3
    • addResolvers

      public ShellMethodArgumentResolverComposite addResolvers(@Nullable List<? extends org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> resolvers)
      Add the given HandlerMethodArgumentResolvers.
    • getResolvers

      public List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> getResolvers()
      Return a read-only list with the contained resolvers, or an empty list.
    • clear

      public void clear()
      Clear the list of configured resolvers and the resolver cache.
    • supportsParameter

      public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
      Whether the given method parameter is supported by any registered HandlerMethodArgumentResolver.
      Specified by:
      supportsParameter in interface org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
    • resolveArgument

      @Nullable public Object resolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.messaging.Message<?> message) throws Exception
      Iterate over registered HandlerMethodArgumentResolvers and invoke the one that supports it.
      Specified by:
      resolveArgument in interface org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver
      Throws:
      IllegalArgumentException - if no suitable argument resolver is found
      Exception