Class AbstractWebQuerySpecificationArgumentResolver
java.lang.Object
in.co.akshitbansal.springwebquery.resolver.spring.AbstractWebQueryResolver
in.co.akshitbansal.springwebquery.resolver.spring.AbstractWebQuerySpecificationArgumentResolver
- All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver
- Direct Known Subclasses:
WebQueryDTOAwareSpecificationArgumentResolver,WebQueryEntityAwareSpecificationArgumentResolver
public abstract class AbstractWebQuerySpecificationArgumentResolver
extends AbstractWebQueryResolver
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 classes/interfaces inherited from class in.co.akshitbansal.springwebquery.resolver.spring.AbstractWebQueryResolver
AbstractWebQueryResolver.QueryConfiguration -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<Class<?>,RSQLCustomOperator<?>> Registered custom operators keyed by implementation class for downstream validation visitors.protected final List<io.github.perplexhub.rsql.RSQLCustomPredicate<?>>Custom predicates adapted forrsql-jpaspecification conversion.protected final cz.jirutka.rsql.parser.RSQLParserParser configured with the allowed default and custom comparison operators.Fields inherited from class in.co.akshitbansal.springwebquery.resolver.spring.AbstractWebQueryResolver
globalAllowAndOperator, globalAllowOrOperator, globalMaxASTDepth -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWebQuerySpecificationArgumentResolver(Set<RSQLDefaultOperator> defaultOperators, Set<? extends RSQLCustomOperator<?>> customOperators, boolean globalAllowAndOperator, boolean globalAllowOrOperator, int globalMaxASTDepth) Creates the resolver base with parser and predicate configuration. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.jpa.domain.Specification<?>resolveArgument(@NonNull org.springframework.core.MethodParameter parameter, org.springframework.web.method.support.ModelAndViewContainer mavContainer, @NonNull org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.bind.support.WebDataBinderFactory binderFactory) protected abstract org.springframework.data.jpa.domain.Specification<?>resolveSpecification(@NonNull AbstractWebQueryResolver.QueryConfiguration queryConfig, @NonNull String filter) Resolves a validated specification for the supplied raw filter value and effective query configuration.booleansupportsParameter(@NonNull org.springframework.core.MethodParameter parameter) Methods inherited from class in.co.akshitbansal.springwebquery.resolver.spring.AbstractWebQueryResolver
getQueryConfiguration
-
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. -
customOperators
Registered custom operators keyed by implementation class for downstream validation visitors.
-
-
Constructor Details
-
AbstractWebQuerySpecificationArgumentResolver
protected AbstractWebQuerySpecificationArgumentResolver(Set<RSQLDefaultOperator> defaultOperators, Set<? extends RSQLCustomOperator<?>> customOperators, 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 generationglobalAllowAndOperator- 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
-
supportsParameter
public boolean supportsParameter(@NonNull @NonNull org.springframework.core.MethodParameter parameter) - Specified by:
supportsParameterin interfaceorg.springframework.web.method.support.HandlerMethodArgumentResolver- Overrides:
supportsParameterin classAbstractWebQueryResolver
-
resolveArgument
public org.springframework.data.jpa.domain.Specification<?> resolveArgument(@NonNull @NonNull org.springframework.core.MethodParameter parameter, org.springframework.web.method.support.ModelAndViewContainer mavContainer, @NonNull @NonNull org.springframework.web.context.request.NativeWebRequest webRequest, org.springframework.web.bind.support.WebDataBinderFactory binderFactory) -
resolveSpecification
protected abstract org.springframework.data.jpa.domain.Specification<?> resolveSpecification(@NonNull @NonNull AbstractWebQueryResolver.QueryConfiguration queryConfig, @NonNull @NonNull String filter) Resolves a validated specification for the supplied raw filter value and effective query configuration.- Parameters:
queryConfig- effective query configuration derived fromWebQueryfilter- raw RSQL filter expression from the request- Returns:
- resolved specification
-