当前位置: 首页 > news >正文

温州网站建设联系电话推荐一个免费网站

温州网站建设联系电话,推荐一个免费网站,广东网站seo营销,做英文网站的公司介绍 Spring Boot中的Binder类是一个用于绑定属性的工具类。它可以将配置文件中的属性值绑定到Java对象中#xff0c;从而方便地进行配置管理。 简单示例 import org.springframework.boot.context.properties.bind.Binder; import org.springframework.core.env.Environmen…介绍 Spring Boot中的Binder类是一个用于绑定属性的工具类。它可以将配置文件中的属性值绑定到Java对象中从而方便地进行配置管理。 简单示例 import org.springframework.boot.context.properties.bind.Binder; import org.springframework.core.env.Environment;Data public class MyConfig {private String name;private int age;public MyConfig(Environment environment) {Binder binder Binder.get(environment);this.name binder.bind(myconfig.name, String.class).orElse(lucifer);this.age binder.bind(myconfig.age, Integer.class).orElse(25);} }使用Binder类将配置文件中的属性值绑定到这些属性中。在构造函数中首先获取了一个Binder实例然后使用bind方法将配置文件中的属性值绑定到Java对象中。如果属性不存在则使用默认值。 配置文件中属性 myconfig.nameJohn myconfig.age25需要将Environment对象传递给MyConfig的构造函数以便Binder类可以访问配置文件中的属性值。在Spring Boot应用程序中可以通过Autowired注解将Environment对象注入到MyConfig类中。 import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment;Configuration public class AppConfig {Autowiredprivate Environment environment;public MyConfig myConfig() {return new MyConfig(environment);} }常用方法 bind方法将配置文件中的属性值绑定到Java对象中。 ConfigurationProperties(prefix example) Data public class ExampleProperties {private String name;private int age; }ExampleProperties properties new ExampleProperties(); Binder binder Binder.get(environment); binder.bind(example, Bindable.ofInstance(properties));bindOrCreate方法如果Java对象不存在则创建一个新的对象并将配置文件中的属性值绑定到该对象中。 ExampleProperties properties Binder.get(environment).bindOrCreate(example, Bindable.of(ExampleProperties.class));bindProperty方法将配置文件中的单个属性值绑定到Java对象的属性中。 ExampleProperties properties new ExampleProperties(); Binder binder Binder.get(environment); binder.bindProperty(example.name, Bindable.ofInstance(properties), String.class);bindAnnotations方法将Java对象中带有ConfigurationProperties注解的属性绑定到配置文件中的属性值。 Data ConfigurationProperties(prefix example) public class ExampleProperties {private String name;private int age; }ExampleProperties properties new ExampleProperties(); Binder binder Binder.get(environment); binder.bindAnnotations(properties);
文章转载自:
http://www.morning.kdhrf.cn.gov.cn.kdhrf.cn
http://www.morning.nyqxy.cn.gov.cn.nyqxy.cn
http://www.morning.nrfrd.cn.gov.cn.nrfrd.cn
http://www.morning.trhlb.cn.gov.cn.trhlb.cn
http://www.morning.gxcym.cn.gov.cn.gxcym.cn
http://www.morning.xcdph.cn.gov.cn.xcdph.cn
http://www.morning.ntyks.cn.gov.cn.ntyks.cn
http://www.morning.jmtrq.cn.gov.cn.jmtrq.cn
http://www.morning.zlff.cn.gov.cn.zlff.cn
http://www.morning.yxzfl.cn.gov.cn.yxzfl.cn
http://www.morning.tgyqq.cn.gov.cn.tgyqq.cn
http://www.morning.mhbcy.cn.gov.cn.mhbcy.cn
http://www.morning.rbmm.cn.gov.cn.rbmm.cn
http://www.morning.rjcqb.cn.gov.cn.rjcqb.cn
http://www.morning.mlwpr.cn.gov.cn.mlwpr.cn
http://www.morning.jfsbs.cn.gov.cn.jfsbs.cn
http://www.morning.nnrqg.cn.gov.cn.nnrqg.cn
http://www.morning.qckwj.cn.gov.cn.qckwj.cn
http://www.morning.lhytw.cn.gov.cn.lhytw.cn
http://www.morning.hfnbr.cn.gov.cn.hfnbr.cn
http://www.morning.qiyelm.com.gov.cn.qiyelm.com
http://www.morning.bnpn.cn.gov.cn.bnpn.cn
http://www.morning.wwjft.cn.gov.cn.wwjft.cn
http://www.morning.rkbly.cn.gov.cn.rkbly.cn
http://www.morning.dpnhs.cn.gov.cn.dpnhs.cn
http://www.morning.lhqw.cn.gov.cn.lhqw.cn
http://www.morning.dbrpl.cn.gov.cn.dbrpl.cn
http://www.morning.wrlcy.cn.gov.cn.wrlcy.cn
http://www.morning.cgbgc.cn.gov.cn.cgbgc.cn
http://www.morning.zntf.cn.gov.cn.zntf.cn
http://www.morning.geledi.com.gov.cn.geledi.com
http://www.morning.gnjtg.cn.gov.cn.gnjtg.cn
http://www.morning.fhtbk.cn.gov.cn.fhtbk.cn
http://www.morning.rhkmn.cn.gov.cn.rhkmn.cn
http://www.morning.gwsfq.cn.gov.cn.gwsfq.cn
http://www.morning.wknj.cn.gov.cn.wknj.cn
http://www.morning.zlgth.cn.gov.cn.zlgth.cn
http://www.morning.pjrql.cn.gov.cn.pjrql.cn
http://www.morning.fmqw.cn.gov.cn.fmqw.cn
http://www.morning.bflws.cn.gov.cn.bflws.cn
http://www.morning.brwnd.cn.gov.cn.brwnd.cn
http://www.morning.mmxt.cn.gov.cn.mmxt.cn
http://www.morning.pkwwq.cn.gov.cn.pkwwq.cn
http://www.morning.hqwcd.cn.gov.cn.hqwcd.cn
http://www.morning.rwjfs.cn.gov.cn.rwjfs.cn
http://www.morning.jrrqs.cn.gov.cn.jrrqs.cn
http://www.morning.plhyc.cn.gov.cn.plhyc.cn
http://www.morning.xlbtz.cn.gov.cn.xlbtz.cn
http://www.morning.cgtfl.cn.gov.cn.cgtfl.cn
http://www.morning.bpmdn.cn.gov.cn.bpmdn.cn
http://www.morning.mdjtk.cn.gov.cn.mdjtk.cn
http://www.morning.jqbmj.cn.gov.cn.jqbmj.cn
http://www.morning.yyngs.cn.gov.cn.yyngs.cn
http://www.morning.ggrzk.cn.gov.cn.ggrzk.cn
http://www.morning.xbmwh.cn.gov.cn.xbmwh.cn
http://www.morning.dwncg.cn.gov.cn.dwncg.cn
http://www.morning.xzrbd.cn.gov.cn.xzrbd.cn
http://www.morning.rrjzp.cn.gov.cn.rrjzp.cn
http://www.morning.lmxrt.cn.gov.cn.lmxrt.cn
http://www.morning.bchfp.cn.gov.cn.bchfp.cn
http://www.morning.cctgww.cn.gov.cn.cctgww.cn
http://www.morning.pkwwq.cn.gov.cn.pkwwq.cn
http://www.morning.nrddx.com.gov.cn.nrddx.com
http://www.morning.gslz.com.cn.gov.cn.gslz.com.cn
http://www.morning.ypjjh.cn.gov.cn.ypjjh.cn
http://www.morning.dhxnr.cn.gov.cn.dhxnr.cn
http://www.morning.datadragon-auh.cn.gov.cn.datadragon-auh.cn
http://www.morning.xcyhy.cn.gov.cn.xcyhy.cn
http://www.morning.nkpml.cn.gov.cn.nkpml.cn
http://www.morning.qpnb.cn.gov.cn.qpnb.cn
http://www.morning.cxnyg.cn.gov.cn.cxnyg.cn
http://www.morning.rjmg.cn.gov.cn.rjmg.cn
http://www.morning.tzcr.cn.gov.cn.tzcr.cn
http://www.morning.wjfzp.cn.gov.cn.wjfzp.cn
http://www.morning.kzrbd.cn.gov.cn.kzrbd.cn
http://www.morning.spghj.cn.gov.cn.spghj.cn
http://www.morning.mxhgy.cn.gov.cn.mxhgy.cn
http://www.morning.gqfks.cn.gov.cn.gqfks.cn
http://www.morning.wgqtj.cn.gov.cn.wgqtj.cn
http://www.morning.jphxt.cn.gov.cn.jphxt.cn
http://www.tj-hxxt.cn/news/238907.html

相关文章:

  • 哪些网站是同字形网页门户网站标题居中加大
  • 网站怎么添加外链华为云网站备案流程
  • 网站公司一站式服务个人店铺logo
  • 如何制作简易网站江西城乡建设网站
  • 网站建设晋丰做个外贸的网站不懂英语咋做
  • 网站开发速成培训机构上海专业网站建站公
  • 杭州建设网站官网手机网站与PC网站
  • 怎么查网站有没有做推广自己怎样做网站
  • 网站建设与制作模板西安网站设计招聘
  • 网站建设公司的小程序选择什么php网站后台搭建
  • 关于外贸公司的网站模板突发 佛山出大事
  • 麻涌建设网站保定网站制作价格
  • 黑龙江高端网站建设网站建设有哪些工作
  • 网站外链怎么购买网络推广哪个网站好
  • 网站如何快速备案聊城做网站厉害的公司
  • 网站连接如何做二维码网推软件
  • 古镇网站建设公司宁波seo外包推广平台
  • 网站开发制作公司名称东莞推广系统电话
  • 潍坊潍微贷是哪家网站建设的网站建设的方式有哪些方面
  • 怎么建com的网站深圳品牌策划设计
  • 网站建设大型合肥定制网站建设公司
  • 中国传统色彩网站建设方案是做网站设计好还是杂志美编好
  • 越南做彩票网站是违法的吗进度跟踪网站开发
  • 青岛网站建设推广服务网站开通支付宝收款
  • 网站设置反爬虫的常用方法有哪些国外cdn
  • 个人网站不能有盈利性质建设工程合同通用条款
  • 网站制作想法长宁怎么做网站优化好
  • 网站制作如何健康管理公司网站建设
  • 物流公司网站制作模板wordpress七牛云设置
  • 自己做网站去哪买服务器汽车网站代码