@Repeatable(value=ContainerMethod.List.class) @Documented @Target(value={ANNOTATION_TYPE,METHOD,TYPE}) @Retention(value=RUNTIME) public @interface ContainerMethod
Indicates that the annotation or the method pointed to by the annotation can be converted to a method container of the specified type. The annotated method needs to meet the following requirements:
type() is MappingType.MAPPED, the return value type must be Map;type() is not MappingType.MAPPED,
the return value can be a single object, array or Collection;
For example, the following example describes how to adapt the requestFoo() method to a data source container:
The first way is to add annotations directly on the method:
{@codecn.crane4j.core.container.MethodInvokerContainer,
cn.crane4j.core.container.MethodContainerFactory| 限定符和类型 | 必需的元素和说明 |
|---|---|
Class<?> |
resultType
Data source object type returned by method.
|
| 限定符和类型 | 可选元素和说明 |
|---|---|
Bind |
bind
When annotations are used on a class,
they are used to bind the corresponding methods in the class.
|
String |
namespace
Namespace of the data source container, use method name when empty.
|
String |
resultKey
The key field of the data source object returned by the method.
|
MappingType |
type
The mapping relationship between the object returned by the method and the target object.
|
public abstract Class<?> resultType
public abstract String namespace
public abstract MappingType type
public abstract String resultKey
public abstract Bind bind
Copyright © 2023. All rights reserved.