public class MethodResultAutoOperateSupport extends Object
Support class for completing the operation for result of method which annotated by AutoOperate.
Before the method is called, the method return type will be resolved
to AutoOperateAnnotatedElement by AutoOperateAnnotatedElementResolver and cached.
After the method is called, the AutoOperateAnnotatedElement
will be used to complete the operation of data from the method result.
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| 限定符和类型 | 字段和说明 |
|---|---|
protected AutoOperateAnnotatedElementResolver |
elementResolver |
protected MethodBaseExpressionExecuteDelegate |
expressionExecuteDelegate |
protected Map<String,AutoOperateAnnotatedElement> |
methodCaches |
| 构造器和说明 |
|---|
MethodResultAutoOperateSupport(AutoOperateAnnotatedElementResolver elementResolver,
MethodBaseExpressionExecuteDelegate expressionExecuteDelegate)
Create a
MethodResultAutoOperateSupport comparator |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterMethodInvoke(AutoOperate annotation,
Method method,
Object result,
Object[] args)
After the method is called, process the returning result
of the method according to the configuration of
ArgAutoOperate annotation. |
protected final Map<String,AutoOperateAnnotatedElement> methodCaches
protected final AutoOperateAnnotatedElementResolver elementResolver
protected final MethodBaseExpressionExecuteDelegate expressionExecuteDelegate
public MethodResultAutoOperateSupport(AutoOperateAnnotatedElementResolver elementResolver, MethodBaseExpressionExecuteDelegate expressionExecuteDelegate)
MethodResultAutoOperateSupport comparatorelementResolver - element handlerexpressionExecuteDelegate - method base expression evaluator delegatepublic void afterMethodInvoke(AutoOperate annotation, Method method, Object result, Object[] args)
ArgAutoOperate annotation.annotation - annotationmethod - methodresult - resultargs - argsCopyright © 2023. All rights reserved.