@Repeatable(value=Assemble.List.class) @Documented @Target(value={ANNOTATION_TYPE,FIELD,TYPE,METHOD}) @Retention(value=RUNTIME) public @interface Assemble
Declare an operation of assemble。
Specify the specific attribute of the current object as the key.
When the operation is executed,
the key value will be extracted and the data source object
obtained from the specified data source container, And map the attribute value
specified in the data source object to the corresponding attribute
of the current object according to the configuration。
for example:
{@code
public class Foo {cn.crane4j.core.parser.TypeHierarchyBeanOperationParser;,
cn.crane4j.core.parser.handler.AssembleAnnotationHandler;| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
container
The namespace of the data source container to be used.
|
String |
containerProvider
The name of the container provider to be used.
|
String[] |
groups
The group to which the current operation belongs.
|
String |
handler
The name of the handler to be used.
|
Class<?> |
handlerType
The type of the handler to be used.
|
String |
key
Field name of key.
|
Class<?> |
keyType
The type to which the key value of target should be converted
when fetching the data source from the data source.
|
String |
propertyMappingStrategy
Get name of property mapping strategy.
|
Mapping[] |
props
Attributes that need to be mapped
between the data source object and the current object.
|
Class<?>[] |
propTemplates
Mapping template classes.
|
int |
sort
Sort values.
|
public abstract int sort
public abstract String key
Field name of key.
This field value will be used to obtain the associated
data source object from the data source container later.
When the annotation is on:
public abstract Class<?> keyType
The type to which the key value of target should be converted when fetching the data source from the data source.
For example, the data source obtained from the data source
is grouped according to the key of the Long type,
and the key value corresponding to the current operation is Integer,
then the keyType needs to be Long at this time.
When the actual operation is performed,
the key value is automatically converted from Integer to Long type.
public abstract String container
public abstract String containerProvider
public abstract String handler
cn.crane4j.core.executor.handler.AssembleOperationHandler;public abstract Class<?> handlerType
cn.crane4j.core.executor.handler.AssembleOperationHandler;public abstract Mapping[] props
propTemplates()public abstract Class<?>[] propTemplates
Mapping template classes.
specify a class, if MappingTemplate exists on the class,
it will scan and add Mapping to props()。
public abstract String[] groups
public abstract String propertyMappingStrategy
cn.crane4j.core.parser.handler.strategy.PropertyMappingStrategyCopyright © 2024. All rights reserved.