Class SpecificationArgumentResolverAutoConfig
java.lang.Object
in.co.akshitbansal.springwebquery.config.specification.SpecificationArgumentResolverAutoConfig
Creates specification resolvers using the starter's global filtering configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionSpecificationArgumentResolverAutoConfig(String GLOBAL_FILTER_PARAM_NAME, boolean GLOBAL_ALLOW_OR_OPERATION, boolean GLOBAL_ALLOW_AND_OPERATION, int GLOBAL_MAX_AST_DEPTH, in.co.akshitbansal.springwebquery.validator.QueryParamNameValidator queryParamNameValidator) Creates the auto-configuration and validates the global filtering properties contributed through application configuration. -
Method Summary
Modifier and TypeMethodDescriptionin.co.akshitbansal.springwebquery.resolver.spring.WebQueryDTOAwareSpecificationArgumentResolverdtoAwareSpecArgumentResolver(cz.jirutka.rsql.parser.RSQLParser rsqlParser, List<io.github.perplexhub.rsql.RSQLCustomPredicate<?>> customPredicates, in.co.akshitbansal.springwebquery.validator.QueryParamNameValidator queryParamNameValidator, in.co.akshitbansal.springwebquery.ast.ValidationRSQLVisitorFactory validationRSQLVisitorFactory) Creates the DTO-aware specification resolver used when@WebQueryexposes a DTO query contract.in.co.akshitbansal.springwebquery.resolver.spring.WebQueryEntityAwareSpecificationArgumentResolverentityAwareSpecArgumentResolver(cz.jirutka.rsql.parser.RSQLParser rsqlParser, List<io.github.perplexhub.rsql.RSQLCustomPredicate<?>> customPredicates, in.co.akshitbansal.springwebquery.validator.QueryParamNameValidator queryParamNameValidator, in.co.akshitbansal.springwebquery.ast.ValidationRSQLVisitorFactory validationRSQLVisitorFactory, in.co.akshitbansal.springwebquery.validator.FieldMappingsValidator fieldMappingsValidator) Creates the entity-aware specification resolver used when@WebQueryresolves selectors directly against entity fields and aliases.
-
Constructor Details
-
SpecificationArgumentResolverAutoConfig
public SpecificationArgumentResolverAutoConfig(@Value("${spring-web-query.filtering.filter-param-name:filter}") String GLOBAL_FILTER_PARAM_NAME, @Value("${spring-web-query.filtering.allow-or-operation:false}") boolean GLOBAL_ALLOW_OR_OPERATION, @Value("${spring-web-query.filtering.allow-and-operation:true}") boolean GLOBAL_ALLOW_AND_OPERATION, @Value("${spring-web-query.filtering.max-ast-depth:1}") int GLOBAL_MAX_AST_DEPTH, in.co.akshitbansal.springwebquery.validator.QueryParamNameValidator queryParamNameValidator) Creates the auto-configuration and validates the global filtering properties contributed through application configuration.- Parameters:
GLOBAL_FILTER_PARAM_NAME- global default request parameter for RSQL filtersGLOBAL_ALLOW_OR_OPERATION- whether logical OR is allowed by defaultGLOBAL_ALLOW_AND_OPERATION- whether logical AND is allowed by defaultGLOBAL_MAX_AST_DEPTH- maximum AST depth allowed by defaultqueryParamNameValidator- validator used for the configured filter parameter name
-
-
Method Details
-
entityAwareSpecArgumentResolver
@Bean @ConditionalOnMissingBean public in.co.akshitbansal.springwebquery.resolver.spring.WebQueryEntityAwareSpecificationArgumentResolver entityAwareSpecArgumentResolver(cz.jirutka.rsql.parser.RSQLParser rsqlParser, List<io.github.perplexhub.rsql.RSQLCustomPredicate<?>> customPredicates, in.co.akshitbansal.springwebquery.validator.QueryParamNameValidator queryParamNameValidator, in.co.akshitbansal.springwebquery.ast.ValidationRSQLVisitorFactory validationRSQLVisitorFactory, in.co.akshitbansal.springwebquery.validator.FieldMappingsValidator fieldMappingsValidator) Creates the entity-aware specification resolver used when@WebQueryresolves selectors directly against entity fields and aliases.- Parameters:
rsqlParser- shared RSQL parsercustomPredicates- shared custom predicate adaptersqueryParamNameValidator- validator for request parameter name overridesvalidationRSQLVisitorFactory- factory for entity-aware validation visitorsfieldMappingsValidator- validator for declared field aliases- Returns:
- entity-aware specification resolver
-
dtoAwareSpecArgumentResolver
@Bean @ConditionalOnMissingBean public in.co.akshitbansal.springwebquery.resolver.spring.WebQueryDTOAwareSpecificationArgumentResolver dtoAwareSpecArgumentResolver(cz.jirutka.rsql.parser.RSQLParser rsqlParser, List<io.github.perplexhub.rsql.RSQLCustomPredicate<?>> customPredicates, in.co.akshitbansal.springwebquery.validator.QueryParamNameValidator queryParamNameValidator, in.co.akshitbansal.springwebquery.ast.ValidationRSQLVisitorFactory validationRSQLVisitorFactory) Creates the DTO-aware specification resolver used when@WebQueryexposes a DTO query contract.- Parameters:
rsqlParser- shared RSQL parsercustomPredicates- shared custom predicate adaptersqueryParamNameValidator- validator for request parameter name overridesvalidationRSQLVisitorFactory- factory for DTO-aware validation visitors- Returns:
- DTO-aware specification resolver
-