Class WebQueryDTOAwareSpecificationArgumentResolver

All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver

public class WebQueryDTOAwareSpecificationArgumentResolver extends AbstractWebQuerySpecificationArgumentResolver
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(String globalFilterParamName, boolean globalAllowAndOperator, boolean globalAllowOrOperator, int globalMaxASTDepth, Set<RSQLDefaultOperator> defaultOperators, Set<? extends RSQLCustomOperator<?>> customOperators)
      Creates a DTO-aware RSQL specification resolver.
      Parameters:
      globalFilterParamName - global default request parameter name used when WebQuery.filterParamName() is blank
      globalAllowAndOperator - whether AND nodes are allowed by default when @WebQuery does not override that behavior
      globalAllowOrOperator - whether OR nodes are allowed by default when @WebQuery does not override that behavior
      globalMaxASTDepth - maximum AST depth allowed by default when @WebQuery does not override that behavior
      defaultOperators - built-in operators accepted in RSQL expressions
      customOperators - custom operators supported by parser and predicates
  • Method Details

    • supportsParameter

      public boolean supportsParameter(@NonNull @NonNull org.springframework.core.MethodParameter parameter)
      Determines whether this resolver should handle the given parameter.
      Specified by:
      supportsParameter in interface org.springframework.web.method.support.HandlerMethodArgumentResolver
      Overrides:
      supportsParameter in class AbstractWebQuerySpecificationArgumentResolver
      Parameters:
      parameter - method parameter under inspection
      Returns:
      true when parameter is a Specification with method-level WebQuery and a configured DTO class
    • resolveSpecification

      protected org.springframework.data.jpa.domain.Specification<?> resolveSpecification(@NonNull @NonNull AbstractWebQuerySpecificationArgumentResolver.QueryConfiguration queryConfig, @NonNull @NonNull String filter)
      Parses, validates, and converts a DTO-oriented RSQL filter into a JPA Specification.
      Specified by:
      resolveSpecification in class AbstractWebQuerySpecificationArgumentResolver
      Parameters:
      queryConfig - effective query configuration for the current request
      filter - raw RSQL filter string from the request
      Returns:
      resolved specification for the validated filter