Class AbstractWebQueryResolver
- All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver
- Direct Known Subclasses:
AbstractWebQueryPageableArgumentResolver,AbstractWebQuerySpecificationArgumentResolver
HandlerMethodArgumentResolver
implementations that participate in WebQuery-driven request parsing.
This class centralizes support detection for controller methods annotated
with WebQuery and computes the effective query configuration by
combining method-level annotation values with global defaults.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected 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. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetQueryConfiguration(@NonNull org.springframework.core.MethodParameter parameter) Resolves the effective query configuration by combining method-levelWebQuerysettings with the configured global fallbacks.protected WebQuerygetWebQueryAnnotation(@NonNull org.springframework.core.MethodParameter parameter) Returns theWebQueryannotation declared on the supplied method parameter's controller method.booleansupportsParameter(@NonNull org.springframework.core.MethodParameter parameter) Determines whether the supplied method parameter belongs to a controller method annotated withWebQuery.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
-
Field Details
-
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
-
AbstractWebQueryResolver
public AbstractWebQueryResolver()
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(@NonNull @NonNull org.springframework.core.MethodParameter parameter) Determines whether the supplied method parameter belongs to a controller method annotated withWebQuery.This base implementation uses
getWebQueryAnnotation(MethodParameter)as the single source of truth for annotation lookup. Missing methods or missing annotations are treated as "not supported" rather than exceptional conditions so Spring MVC can continue evaluating other resolvers.- Specified by:
supportsParameterin interfaceorg.springframework.web.method.support.HandlerMethodArgumentResolver- Parameters:
parameter- method parameter under inspection- Returns:
truewhen the declaring method hasWebQuery, otherwisefalse
-
getQueryConfiguration
protected AbstractWebQueryResolver.QueryConfiguration getQueryConfiguration(@NonNull @NonNull org.springframework.core.MethodParameter parameter) Resolves the effective query configuration by combining method-levelWebQuerysettings with the configured global fallbacks.- Parameters:
parameter- supported method parameter whose declaring method carriesWebQuery- Returns:
- effective configuration used by specification resolvers for validation and parsing
-
getWebQueryAnnotation
protected WebQuery getWebQueryAnnotation(@NonNull @NonNull org.springframework.core.MethodParameter parameter) Returns theWebQueryannotation declared on the supplied method parameter's controller method.This helper centralizes annotation lookup for both support detection and downstream configuration resolution. Callers that need boolean support checks should use
supportsParameter(MethodParameter); this method is for subclasses that expect a supported parameter and therefore treat missing method metadata as a programming error.- Parameters:
parameter- method parameter whose declaring method is expected to carryWebQuery- Returns:
- resolved
WebQueryannotation - Throws:
IllegalStateException- if the parameter has no declaring method or the declaring method is not annotated withWebQuery
-