0
点赞
收藏
分享

微信扫一扫

bert系列模型区别(bert-base-cased/bert-base-uncased/bert-base-chinese)

毅会 2024-09-27 阅读 18

在这里插入图片描述
 &emps;在上一篇文章中,我们介绍了两种配置文件的方式,那么在添加完配置文件之后,我们如何从配置文件中获取到对应配置的值呢?这篇文章中我们就来看看这个问题。

  一般的说SpringBoot中读取配置文件的方式有两种

  • @Value注解:基于@Value注解进行配置,一般适用于单个属性值的注入,这是一种直接进行注入的方式实现。不需要太多的配置内容
  • @ConfigurationProperties注解:这种配置方式主要是用于在同一个前缀下的多个配置项的时候使用,也是在Spring Boot自动配置中使用的配置方式。

@ConfigurationProperties 配置文件

  这个注解主要是用来从配置文件中获取配置内容,支持基本配置项和复杂配置项,但是不能支持SPEL表达式配置。这个注解源码如下

@Target({
    ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Indexed
public @interface ConfigurationProperties {
   

	/**
	 * The prefix of the properties that are valid to bind to this object. Synonym for
	 * {@link #prefix()}. A valid prefix is defined by one or more words separated with
	 * dots (e.g. {@code "acme.system.feature"}).
	 * @return the prefix of the properties to bind
	 */
	@AliasFor("prefix")
	String 
举报

相关推荐

0 条评论