Skip to content
New issue

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

Converter不支持自定义方式去实例化吗? #3172

Open
zxy900213 opened this issue May 5, 2023 · 4 comments
Open

Converter不支持自定义方式去实例化吗? #3172

zxy900213 opened this issue May 5, 2023 · 4 comments
Labels
help wanted Extra attention is needed planning It may be developed later spring-planning about spring context

Comments

@zxy900213
Copy link

image
看代码似乎写死使用无参构造函数创建Converter实例,如果在Converter实例创建之后,想要为该实例的属性赋值,该怎么做?
是否可以灵活一点,能够自定义实例化方式?比如使用Spring容器去创建实例。

@zxy900213 zxy900213 added the help wanted Extra attention is needed label May 5, 2023
@gongxuanzhang
Copy link
Collaborator

目前不支持,会增强API
目前解决的方式可以用委托的方式

public class YourConverter {
 public static Converter springConverter =  null;

public static void set(YourConverter yourSpringConverter){
   YourConverter.springConverter = yourSpringConverter;
}

//   delegate method

}

@zxy900213
Copy link
Author

zxy900213 commented May 19, 2023 via email

@gongxuanzhang gongxuanzhang added planning It may be developed later spring-planning about spring context labels May 19, 2023
@gongxuanzhang
Copy link
Collaborator

你好,我们发现此Issue已经超过三个月没有活动了,为了更好的帮助您解决问题,我们将在7天后关闭此Issue,如果您仍然有问题,请在7天内回复此Issue,谢谢!如果您已经解决或者不需要帮助,请忽略此消息。

@zxy900213
Copy link
Author

zxy900213 commented Jul 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed planning It may be developed later spring-planning about spring context
Projects
None yet
Development

No branches or pull requests

2 participants