Class WebQuerySpecificationArgumentResolver

java.lang.Object
in.co.akshitbansal.springwebquery.resolver.WebQuerySpecificationArgumentResolver
All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver
Direct Known Subclasses:
WebQueryDTOAwareSpecificationArgumentResolver, WebQueryEntityAwareSpecificationArgumentResolver

public abstract class WebQuerySpecificationArgumentResolver extends Object implements org.springframework.web.method.support.HandlerMethodArgumentResolver
Base HandlerMethodArgumentResolver for resolving RSQL-based Specification parameters.

This class initializes a parser constrained to the configured default and custom operators, and adapts custom operators into RSQLCustomPredicate instances accepted by the underlying rsql-jpa integration.

  • Field Details

    • rsqlParser

      protected final cz.jirutka.rsql.parser.RSQLParser rsqlParser
      Parser configured with the allowed default and custom comparison operators.
    • customPredicates

      protected final List<io.github.perplexhub.rsql.RSQLCustomPredicate<?>> customPredicates
      Custom predicates adapted for rsql-jpa specification conversion.
    • annotationUtil

      protected final AnnotationUtil annotationUtil
      Utility for annotation resolution and validation support in subclasses.
    • globalAllowAndOperator

      protected final boolean globalAllowAndOperator
      Global default applied when WebQuery.allowAndOperator() is set to WebQuery.OperatorPolicy.GLOBAL.
    • globalAllowOrOperator

      protected final boolean globalAllowOrOperator
      Global default applied when WebQuery.allowOrOperator() is set to WebQuery.OperatorPolicy.GLOBAL.
    • globalMaxASTDepth

      protected final int globalMaxASTDepth
      Global default applied when WebQuery.maxASTDepth() is left at its sentinel value.
  • Constructor Details

    • WebQuerySpecificationArgumentResolver

      protected WebQuerySpecificationArgumentResolver(Set<RSQLDefaultOperator> defaultOperators, Set<? extends RSQLCustomOperator<?>> customOperators, AnnotationUtil annotationUtil, boolean globalAllowAndOperator, boolean globalAllowOrOperator, int globalMaxASTDepth)
      Creates the resolver base with parser and predicate configuration.
      Parameters:
      defaultOperators - built-in operators accepted by the parser
      customOperators - custom operators to register for parsing and predicate generation
      annotationUtil - utility for annotation resolution and validation
      globalAllowAndOperator - fallback AND-node policy used when @WebQuery defers to global settings
      globalAllowOrOperator - fallback OR-node policy used when @WebQuery defers to global settings
      globalMaxASTDepth - fallback maximum AST depth used when @WebQuery defers to global settings
  • Method Details

    • getQueryConfiguration

      protected WebQuerySpecificationArgumentResolver.QueryConfiguration getQueryConfiguration(@NonNull @NonNull WebQuery webQueryAnnotation)
      Resolves the effective query configuration by combining method-level WebQuery settings with the configured global fallbacks.
      Parameters:
      webQueryAnnotation - controller method annotation supplying query settings
      Returns:
      effective configuration used by specification resolvers for validation and parsing