Class AbstractWebQueryResolver

java.lang.Object
in.co.akshitbansal.springwebquery.resolver.spring.AbstractWebQueryResolver
All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver
Direct Known Subclasses:
AbstractWebQueryPageableArgumentResolver, AbstractWebQuerySpecificationArgumentResolver

public abstract class AbstractWebQueryResolver extends Object implements org.springframework.web.method.support.HandlerMethodArgumentResolver
Common base for HandlerMethodArgumentResolver implementations that participate in WebQuery-driven request parsing.

This class centralizes support detection for controller methods annotated with WebQuery and computes the effective query configuration by combining method-level annotation values with global defaults.

  • Field Details

  • Constructor Details

    • AbstractWebQueryResolver

      public AbstractWebQueryResolver()
  • Method Details

    • supportsParameter

      public boolean supportsParameter(@NonNull @NonNull org.springframework.core.MethodParameter parameter)
      Determines whether the supplied method parameter belongs to a controller method annotated with WebQuery.

      This base implementation uses getWebQueryAnnotation(MethodParameter) as the single source of truth for annotation lookup. Missing methods or missing annotations are treated as "not supported" rather than exceptional conditions so Spring MVC can continue evaluating other resolvers.

      Specified by:
      supportsParameter in interface org.springframework.web.method.support.HandlerMethodArgumentResolver
      Parameters:
      parameter - method parameter under inspection
      Returns:
      true when the declaring method has WebQuery, otherwise false
    • getQueryConfiguration

      protected AbstractWebQueryResolver.QueryConfiguration getQueryConfiguration(@NonNull @NonNull org.springframework.core.MethodParameter parameter)
      Resolves the effective query configuration by combining method-level WebQuery settings with the configured global fallbacks.
      Parameters:
      parameter - supported method parameter whose declaring method carries WebQuery
      Returns:
      effective configuration used by specification resolvers for validation and parsing
    • getWebQueryAnnotation

      protected WebQuery getWebQueryAnnotation(@NonNull @NonNull org.springframework.core.MethodParameter parameter)
      Returns the WebQuery annotation declared on the supplied method parameter's controller method.

      This helper centralizes annotation lookup for both support detection and downstream configuration resolution. Callers that need boolean support checks should use supportsParameter(MethodParameter); this method is for subclasses that expect a supported parameter and therefore treat missing method metadata as a programming error.

      Parameters:
      parameter - method parameter whose declaring method is expected to carry WebQuery
      Returns:
      resolved WebQuery annotation
      Throws:
      IllegalStateException - if the parameter has no declaring method or the declaring method is not annotated with WebQuery