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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotationUtilUtility for annotation resolution and validation support in subclasses.protected final List<io.github.perplexhub.rsql.RSQLCustomPredicate<?>> Custom predicates adapted forrsql-jpaspecification conversion.protected final booleanGlobal default applied whenWebQuery.allowAndOperator()is set toWebQuery.OperatorPolicy.GLOBAL.protected final booleanGlobal default applied whenWebQuery.allowOrOperator()is set toWebQuery.OperatorPolicy.GLOBAL.protected final intGlobal default applied whenWebQuery.maxASTDepth()is left at its sentinel value.protected final cz.jirutka.rsql.parser.RSQLParserParser configured with the allowed default and custom comparison operators. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWebQuerySpecificationArgumentResolver(Set<RSQLDefaultOperator> defaultOperators, Set<? extends RSQLCustomOperator<?>> customOperators, AnnotationUtil annotationUtil, boolean globalAllowAndOperator, boolean globalAllowOrOperator, int globalMaxASTDepth) Creates the resolver base with parser and predicate configuration. -
Method Summary
Modifier and TypeMethodDescriptiongetQueryConfiguration(@NonNull WebQuery webQueryAnnotation) Resolves the effective query configuration by combining method-levelWebQuerysettings with the configured global fallbacks.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.method.support.HandlerMethodArgumentResolver
resolveArgument, supportsParameter
-
Field Details
-
rsqlParser
protected final cz.jirutka.rsql.parser.RSQLParser rsqlParserParser configured with the allowed default and custom comparison operators. -
customPredicates
Custom predicates adapted forrsql-jpaspecification conversion. -
annotationUtil
Utility for annotation resolution and validation support in subclasses. -
globalAllowAndOperator
protected final boolean globalAllowAndOperatorGlobal default applied whenWebQuery.allowAndOperator()is set toWebQuery.OperatorPolicy.GLOBAL. -
globalAllowOrOperator
protected final boolean globalAllowOrOperatorGlobal default applied whenWebQuery.allowOrOperator()is set toWebQuery.OperatorPolicy.GLOBAL. -
globalMaxASTDepth
protected final int globalMaxASTDepthGlobal default applied whenWebQuery.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 parsercustomOperators- custom operators to register for parsing and predicate generationannotationUtil- utility for annotation resolution and validationglobalAllowAndOperator- fallback AND-node policy used when@WebQuerydefers to global settingsglobalAllowOrOperator- fallback OR-node policy used when@WebQuerydefers to global settingsglobalMaxASTDepth- fallback maximum AST depth used when@WebQuerydefers to global settings
-
-
Method Details
-
getQueryConfiguration
protected WebQuerySpecificationArgumentResolver.QueryConfiguration getQueryConfiguration(@NonNull @NonNull WebQuery webQueryAnnotation) Resolves the effective query configuration by combining method-levelWebQuerysettings with the configured global fallbacks.- Parameters:
webQueryAnnotation- controller method annotation supplying query settings- Returns:
- effective configuration used by specification resolvers for validation and parsing
-