在自定义组件中获取spring底层组件
Posted 西班牙乞丐
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在自定义组件中获取spring底层组件相关的知识,希望对你有一定的参考价值。
要想在自定义组件中获取spring底层的各种组件,只需让自定义组件实现一系列接口即可,这些接口都是Aware的子接口。常见的有:
1. ApplicationContextAware——用于获取IOC容器;
2. BeanNameAware——用于获取bean的名称;
3. EmbeddedValueResolverAware——用于获取字符串解析器,可以解析各种占位符,例如${}、$#{}等。
示例代码如下,自定义bean类实现了三种Aware接口
public class Candy implements ApplicationContextAware, BeanNameAware, EmbeddedValueResolverAware {
//bean的名称
private String name;
//容器
private ApplicationContext applicationContext;
//配置文件中的值
private String nickname;
@Override
public void setBeanName(String name) {
this.name = name;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
this.nickname = resolver.resolveStringValue("${bottle.nickname}");
}
}
!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6Ijk0NjUtMTU1NTIxMjkxMjY4MiIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI6InBhcmFncmFwaCIsInJpY2hUZXh0Ijp7ImRhdGEiOlt7ImNoYXIiOiLopoEiLCJzdHlsZXMiOnsiZm9udC1zaXplIjoxOH19LHsiY2hhciI6IuaDsyIsInN0eWxlcyI6eyJmb250LXNpemUiOjE4fX0seyJjaGFyIjoi5ZyoIiwic3R5bGVzIjp7ImZvbnQtc2l6ZSI6MTh9fSx7ImNoYXIiOiLoh6oiLCJzdHlsZXMiOnsiZm9udC1zaXplIjoxOH19LHsiY2hhciI6IuWumiIsInN0eWxlcyI6eyJmb250LXN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zaXplIjoxOH19LHsiY2hhciI6Iu+8jCIsInN0eWxlcyI6eyJmb250LXNpemUiOjE4fX0seyJjaGFyIjoi5L6LIiwic3R5bGVzIjp7ImZvbnQtc2l6ZSI6MTh9fSx7ImNoYXIiOiLlpoIiLCJzdHlsZXMiOnsiZm9udC1zaXplIjoxOH19LHsiY2hhciI6IiQiLCJzdHlsZXMiOnsiZm9udC1zaXplIjoxOH19LHsiY2hhciI6InsiLCJzdHlsZXMiOnsiZm9udC1zaXplIjoxOH19LHsiY2hhciI6In0iLCJzdHlsZXMiOnsiZm9udC1zaXplIjoxOH19LHsiY2hhciI6IuOAgSIsInN0eWxlcyI6eyJmb250LXNpemUiOjE4fX0seyJjaGFyIjoiJCIsInN0eWxlcyI6eyJmb250LXNpemUiOjE4fX0seyJjaGFyIjoiIyIsInN0eWxlcyI6eyJmb250LXNpemUiOjE4fX0seyJjaGFyIjoieyIsInN0eWxlcyI6eyJmb250LXNpemUiOjE4fX0seyJjaGFyIjoifSIsInN0eWxlcyI6eyJmb250LXNpemUiOjE4fX0seyJjaGFyIjoi562JIiwic3R5bGVzIjp7ImZvbnQtc2l6ZSI6MTh9fSx7ImNoYXIiOiLjgIIiLCJzdHlsZXMiOnsiZm9udC1zaXplIjoxOH19XSwiaXNSaWNoVGV4dCI6dHJ1ZSwia2VlcExpbmVCcmVhayI6dHJ1ZX19XQ==-->以上是关于在自定义组件中获取spring底层组件的主要内容,如果未能解决你的问题,请参考以下文章
Android - 在自定义对话框中获取组件的句柄
如何在自定义验证器中获取另一个组件的值? [复制]
如何在自定义验证器中获取另一个组件的值? [复制]
Vue_(组件通讯)使用solt分发内容
使用 Spring“context-property-placeholder”在自定义 taglib 中获取配置设置
运行时分配操作的快捷方式不会在自定义组件中触发