Skip to content

Commit

Permalink
docs: supplementary code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Createsequence committed Oct 30, 2023
1 parent 46e7180 commit b65f732
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* </pre>
* or:
* <pre class="code">
* &#64;ArgAutoOperate
* public void doSomething(
* &#64;AutoOperate(value = "list", type = A.class) List<A> list,
* &#64;AutoOperate(value = "b", type = B.class) B b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* @author huangchengxing
* @see cn.crane4j.core.parser.TypeHierarchyBeanOperationParser;
* @see cn.crane4j.core.parser.handler.AssembleEnumAnnotationHandler;
* @see 1.3.0
*/
@Repeatable(value = AssembleEnum.List.class)
@Documented
Expand Down Expand Up @@ -40,6 +41,7 @@
* Configuration of container.
*
* @return {@link ContainerEnum} annotation.
* @since 2.4.0
*/
ContainerEnum enums() default @ContainerEnum;

Expand All @@ -57,6 +59,7 @@
* the configuration defined by that annotation will be used first.
*
* @return boolean
* @since 2.4.0
*/
boolean followTypeConfig() default true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
* @author huangchengxing
* @see cn.crane4j.core.support.operator.DynamicContainerOperatorProxyMethodFactory
* @see cn.crane4j.core.support.ContainerAdapterRegister
* @since 1.3.0
*/
@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public <K, V> V choose(K key, V oldVal, V newVal) {
}),

/**
* When the keys are the same, discard the new key value.
* When the key already exists, discard the new key value.
*/
DISCARD_OLD(new Selector() {
@Override
Expand All @@ -47,7 +47,7 @@ public <K, V> V choose(K key, V oldVal, V newVal) {
}),

/**
* When the keys are the same, discard the new value and old value, return null.
* When the key already exists, discard the new value and old value, return null.
*/
DISCARD(new Selector() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* which describes which data object attributes are mapped to which target object attributes.
*
* @author huangchengxing
* @see Assemble#props()
* @see MappingTemplate
* @see cn.crane4j.core.parser.PropertyMapping
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* An {@link AbstractAssembleAnnotationHandler} implementation for {@link AssembleEnum} annotation.
*
* @author huangchengxing
* @see AssembleEnum
* @since 1.3.0
*/
@Slf4j
Expand Down
14 changes: 11 additions & 3 deletions website/docs/user_guide/basic_concept.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@ BeanOperations operations = parser.parse(Foo.class);

你还可以在注解中调整字段的映射规则、指定操作的执行顺序,或通过指定分组来选择性的跳过一些操作,具体参见后文 “[装配操作](./../basic/declare_assemble_operation.md)” 与 “[属性映射](./../basic/property_mapping.md)” 相关内容。

## 4.操作执行器
## 4.注解处理器

![](http://img.xiajibagao.top/%E6%97%A0%E6%A0%87%E9%A2%98-2023-06-04-1303.png)

crane4j 支持通过各种注解快速的配置填充和拆卸操作,它们实际上是通过注册在操作配置解析器 `BeanOperationParser` 中的注解处理器 `OperationAnnotationHandler` 进行处理的。

当我们使用解析器对类及类的属性进行解析式,都会依次调用一遍注解处理器,每种注解处理器都专注于将某一类注解解析为相应的转配操作 `AssembleOperation` 或拆卸操作 `DisassembleOperation`

## 5.操作执行器

![BeanOperationExecutor](https://img.xiajibagao.top/image-20230221133602215.png)

Expand All @@ -129,7 +137,7 @@ executor.execute(foos, operations);

直接使用操作执行器的场景相对罕见,仅在需要使用少部分特殊功能时才会出现。

## 5.填充方式
## 6.填充方式

crane4j 提供了两类填充方式,它们主要的区别在于填充的触发时机:

Expand All @@ -147,7 +155,7 @@ crane4j 提供了两类填充方式,它们主要的区别在于填充的触发

关于它们的使用方式,具体参见后文 “[触发操作](./../basic/trigger_operation.md)” 一节。

## 6.配置风格
## 7.配置风格

![ConfigurationStyle](http://img.xiajibagao.top/image-20231013011413703.png)

Expand Down

0 comments on commit b65f732

Please sign in to comment.