public class MethodArgumentAutoOperateSupport extends Object
Support class for completing the operation of data
from the method parameters which annotated by AutoOperate
before the method is called.
Before the method is called, the method parameters will be resolved
to AutoOperateAnnotatedElement array by AutoOperateAnnotatedElementResolver,
and then the AutoOperateAnnotatedElement array will be cached.
When the method is called, the AutoOperateAnnotatedElement array
will be used to complete the operation of data from the method parameters.
Support expression for AutoOperate.condition(), if the expression is not empty,
the expression will be evaluated by MethodBaseExpressionExecuteDelegate,
only when the expression returns true or "true", the operation will be applied.
AutoOperateAnnotatedElementResolver,
MethodBaseExpressionExecuteDelegate,
AutoOperate,
ArgAutoOperate| 限定符和类型 | 字段和说明 |
|---|---|
protected AnnotationFinder |
annotationFinder |
protected AutoOperateAnnotatedElementResolver |
elementResolver |
protected static AutoOperateAnnotatedElement[] |
EMPTY_ELEMENTS |
protected MethodBaseExpressionExecuteDelegate |
expressionExecuteDelegate |
protected Map<String,AutoOperateAnnotatedElement[]> |
methodParameterCaches |
protected ParameterNameFinder |
parameterNameFinder |
| 构造器和说明 |
|---|
MethodArgumentAutoOperateSupport(AutoOperateAnnotatedElementResolver elementResolver,
MethodBaseExpressionExecuteDelegate expressionExecuteDelegate,
ParameterNameFinder parameterNameFinder,
AnnotationFinder annotationFinder)
Create a
MethodArgumentAutoOperateSupport comparator. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
beforeMethodInvoke(Method method,
Object[] args)
Before the method is called, process the input parameters
of the method according to the configuration of
ArgAutoOperate or AutoOperate annotation. |
protected void |
processArguments(Method method,
Object[] args,
AutoOperateAnnotatedElement[] autoOperateAnnotatedElements)
Processing method input arguments.
|
protected AutoOperateAnnotatedElement[] |
resolveParameters(@Nullable ArgAutoOperate argAutoOperate,
Method method)
Analyze the annotations on methods and method parameters
to obtain the operation configuration of method parameters.
|
protected static final AutoOperateAnnotatedElement[] EMPTY_ELEMENTS
protected final AutoOperateAnnotatedElementResolver elementResolver
protected final Map<String,AutoOperateAnnotatedElement[]> methodParameterCaches
protected final ParameterNameFinder parameterNameFinder
protected final AnnotationFinder annotationFinder
protected final MethodBaseExpressionExecuteDelegate expressionExecuteDelegate
public MethodArgumentAutoOperateSupport(AutoOperateAnnotatedElementResolver elementResolver, MethodBaseExpressionExecuteDelegate expressionExecuteDelegate, ParameterNameFinder parameterNameFinder, AnnotationFinder annotationFinder)
MethodArgumentAutoOperateSupport comparator.elementResolver - element handlerexpressionExecuteDelegate - expression evaluator delegateparameterNameFinder - parameter name finderannotationFinder - annotation finderpublic final void beforeMethodInvoke(Method method, Object[] args)
ArgAutoOperate or AutoOperate annotation.method - methodargs - argsprotected void processArguments(Method method, Object[] args, AutoOperateAnnotatedElement[] autoOperateAnnotatedElements)
method - methodargs - argsautoOperateAnnotatedElements - resolved elementsprotected AutoOperateAnnotatedElement[] resolveParameters(@Nullable ArgAutoOperate argAutoOperate, Method method)
argAutoOperate - argAutoOperatemethod - methodCopyright © 2023. All rights reserved.