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 detection of controller method parameters whose declaring method carries WebQuery and exposes a shared helper for retrieving that annotation once support has been established.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected WebQuery
    getWebQueryAnnotation(@NonNull org.springframework.core.MethodParameter parameter)
    Returns the WebQuery annotation declared on the supplied method parameter's controller method.
    boolean
    supportsParameter(@NonNull org.springframework.core.MethodParameter parameter)
    Determines whether the supplied method parameter belongs to a controller method annotated with WebQuery.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.method.support.HandlerMethodArgumentResolver

    resolveArgument
  • 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
    • 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