We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@AssembleConstant
提供一个 @AssembleConstant 注解,用于基于静态常量完成填充。比如:
public class Foo { @AssembleConstant( type = Constant.class, // 指定常量类 props = @Mapping(ref = "name") // 将值映射到 `name` 属性 ) private Integer value; private String name; }
并且,该注解应当支持引用对象中的 Map 集合或者 Collection 集合的属性,比如:
public class Foo { @AssembleConstant( type = Constant.class, // 指定常量类 on = "STRATEGIES_MAP" props = @Mapping(ref = "name") // 将值映射到 `name` 属性 ) private Integer value; private String name; } public static final class Constant { private static final Map<String, Strategy> STRATEGIES_MAP = new HashMap<>(); }
此处可参照 @AssembleMethod,支持从 Spring 容器中获得 Bean。
@AssembleMethod
其中,对于 @AssembleConstant 注解:
sort
props
@AssembleEnum
@ConstantContainer
该功能可参考 @Assemble 注解与其对应的解析器 AssembleAnnotationHandler 完成。
@Assemble
AssembleAnnotationHandler
The text was updated successfully, but these errors were encountered:
DynamicContainerOperatorProxyMethodFactory
feat(assemble): support for optional style constant assemble operatio…
b382baa
…ns (GitHub ##135)
9c5f2d5
No branches or pull requests
提供一个
@AssembleConstant
注解,用于基于静态常量完成填充。比如:并且,该注解应当支持引用对象中的 Map 集合或者 Collection 集合的属性,比如:
此处可参照
@AssembleMethod
,支持从 Spring 容器中获得 Bean。其中,对于
@AssembleConstant
注解:sort
、props
在内的各种标准属性;@AssembleEnum
一样,支持可选是否要遵循@ConstantContainer
上的配置;该功能可参考
@Assemble
注解与其对应的解析器AssembleAnnotationHandler
完成。The text was updated successfully, but these errors were encountered: