@Target(value={METHOD,PARAMETER,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Documented public @interface AutoOperate
Declare the return value or parameter of the method(if the method is annotated by ArgAutoOperate) need process.
ArgAutoOperate,
cn.crane4j.core.support.aop.MethodResultAutoOperateSupport,
cn.crane4j.core.support.aop.MethodArgumentAutoOperateSupport,
cn.crane4j.core.support.aop.AutoOperateAnnotatedElementResolver| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
condition
The expression of apply condition.
|
String[] |
excludes
The group of operations not to be performed.
|
String |
executor
The name of the executor to be used.
|
Class<?> |
executorType
The type of the executor to be used.
|
String[] |
includes
The group of operations to be performed.
|
String |
on
When the return value is a wrapper class,
we can specify to obtain the data set to be processed
from the specific field of the wrapper class, and then process it。
|
String |
parser
The name of the operation parser to be used.
|
Class<?> |
parserType
The type of the operation parser to be used.
|
Class<?> |
type
The object type to be processed in the return value of the method.
|
String |
value
When used in
ArgAutoOperate, it is used to bind the corresponding parameter name. |
public abstract String value
ArgAutoOperate, it is used to bind the corresponding parameter name.public abstract Class<?> type
The object type to be processed in the return value of the method.
It will be parsed by the parser specified in parser() when it is first executed,
and then the operation configuration will be obtained.
If the object is generic or cannot be confirmed, the default value is Object,
and the type will be automatically inferred.
cn.crane4j.core.support.TypeResolverpublic abstract String on
When the return value is a wrapper class,
we can specify to obtain the data set to be processed
from the specific field of the wrapper class, and then process it。
This configuration is generally used to process the method
of returning the general response body in the Controller。
For example:
// general response public static class Result{ private Integer code; private T data; // objects to be processed } // process general response
public abstract String executor
cn.crane4j.core.executor.BeanOperationExecutorpublic abstract Class<?> executorType
cn.crane4j.core.executor.BeanOperationExecutorpublic abstract String parser
cn.crane4j.core.parser.BeanOperationParserpublic abstract Class<?> parserType
cn.crane4j.core.parser.BeanOperationParserpublic abstract String[] includes
public abstract String[] excludes
The group of operations not to be performed.
The priority of this configuration is higher than includes()
public abstract String condition
The expression of apply condition.
The operation will only be performed when the expression result is true or "true" string。
The following variables can be used by default in the expression:
@beanName:beans in spring context;#parameterName: arguments of method;#result: return value of method;Copyright © 2023. All rights reserved.