Class DtoAwareRsqlSpecArgumentResolver
java.lang.Object
in.co.akshitbansal.springwebquery.resolver.RsqlSpecArgumentResolver
in.co.akshitbansal.springwebquery.resolver.DtoAwareRsqlSpecArgumentResolver
- All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver
DTO-based resolver for
Specification parameters annotated with
RsqlSpec.
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.
-
Field Summary
Fields inherited from class in.co.akshitbansal.springwebquery.resolver.RsqlSpecArgumentResolver
annotationUtil, customPredicates, rsqlParser -
Constructor Summary
ConstructorsConstructorDescriptionDtoAwareRsqlSpecArgumentResolver(Set<RsqlOperator> defaultOperators, Set<? extends RsqlCustomOperator<?>> customOperators, AnnotationUtil annotationUtil) Creates a DTO-aware RSQL specification resolver. -
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectresolveArgument(@NonNull org.springframework.core.MethodParameter parameter, @Nullable org.springframework.web.method.support.ModelAndViewContainer mavContainer, @NonNull org.springframework.web.context.request.NativeWebRequest webRequest, @Nullable org.springframework.web.bind.support.WebDataBinderFactory binderFactory) Resolves aSpecificationfrom the configured RSQL request parameter.booleansupportsParameter(org.springframework.core.MethodParameter parameter) Determines whether this resolver should handle the given parameter.
-
Constructor Details
-
DtoAwareRsqlSpecArgumentResolver
public DtoAwareRsqlSpecArgumentResolver(Set<RsqlOperator> defaultOperators, Set<? extends RsqlCustomOperator<?>> customOperators, AnnotationUtil annotationUtil) Creates a DTO-aware RSQL specification resolver.- Parameters:
defaultOperators- built-in operators accepted in RSQL expressionscustomOperators- custom operators supported by parser and predicatesannotationUtil- utility for resolving annotations and configuration checks
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) Determines whether this resolver should handle the given parameter. -
resolveArgument
public @Nullable Object resolveArgument(@NonNull @NonNull org.springframework.core.MethodParameter parameter, @Nullable org.springframework.web.method.support.ModelAndViewContainer mavContainer, @NonNull @NonNull org.springframework.web.context.request.NativeWebRequest webRequest, @Nullable org.springframework.web.bind.support.WebDataBinderFactory binderFactory) throws Exception Resolves aSpecificationfrom the configured RSQL request parameter.- Parameters:
parameter- controller method parameter being resolvedmavContainer- current MVC containerwebRequest- current requestbinderFactory- binder factory- Returns:
- resolved specification, or
Specification.unrestricted()when no filter exists - Throws:
Exception- when resolution fails
-