Class WebQueryDtoAwareSpecificationArgumentResolver

java.lang.Object
in.co.akshitbansal.springwebquery.resolver.WebQuerySpecificationArgumentResolver
in.co.akshitbansal.springwebquery.resolver.WebQueryDtoAwareSpecificationArgumentResolver
All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver

public class WebQueryDtoAwareSpecificationArgumentResolver extends WebQuerySpecificationArgumentResolver
DTO-based resolver for Specification parameters handled via method-level WebQuery.

This resolver is active when WebQuery.dtoClass() is configured. Incoming RSQL selectors are validated against DTO fields and then translated to entity paths before the specification is produced.

  • Constructor Details

    • WebQueryDtoAwareSpecificationArgumentResolver

      public WebQueryDtoAwareSpecificationArgumentResolver(Set<RsqlOperator> defaultOperators, Set<? extends RsqlCustomOperator<?>> customOperators, AnnotationUtil annotationUtil)
      Creates a DTO-aware RSQL specification resolver.
      Parameters:
      defaultOperators - built-in operators accepted in RSQL expressions
      customOperators - custom operators supported by parser and predicates
      annotationUtil - utility for resolving annotations and configuration checks
  • Method Details

    • supportsParameter

      public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
      Determines whether this resolver should handle the given parameter.
      Parameters:
      parameter - method parameter under inspection
      Returns:
      true when parameter is a Specification with method-level WebQuery and a configured DTO class
    • resolveArgument

      public @Nullable Object resolveArgument(@NonNull @NonNull org.springframework.core.MethodParameter parameter, @Nullable org.springframework.web.method.support.ModelAndViewContainer mavContainer, @NonNull @NonNull org.springframework.web.context.request.NativeWebRequest webRequest, @Nullable org.springframework.web.bind.support.WebDataBinderFactory binderFactory) throws Exception
      Resolves a Specification from the configured RSQL request parameter.
      Parameters:
      parameter - controller method parameter being resolved
      mavContainer - current MVC container
      webRequest - current request
      binderFactory - binder factory
      Returns:
      resolved specification, or Specification.unrestricted() when no filter exists
      Throws:
      Exception - when resolution fails