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

怎么样用ps做网站平面设计机构培训

怎么样用ps做网站,平面设计机构培训,房建设计图网站,网站建设维护杭州介绍 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.w-s-a.com/news/261534/

相关文章:

  • 如何取消网站备案佛山网站优化公司
  • 网站开发 成都广水网站设计
  • 音乐网站建设目标合同管理系统
  • jq网站特效插件如何知道网站是否被k
  • 自己的网站怎么接广告网站搭建收费
  • 宁波大型网站制作建立一个网站 优帮云
  • 大连零基础网站建设教学电话有哪些比较好的做ppt好的网站
  • 哪个网站做logo设计我的建筑网
  • php电子商务网站开发沂源手机网站建设公司
  • html和php做网站哪个好3gcms企业手机网站整站源码asp
  • 网站建设网页设计案例云南建设厅网站删除
  • 杏坛网站制作太原做网站要多少钱呢
  • 做新闻类网站还有市场吗东莞黄页网广告
  • 地方网站做外卖专业做互联网招聘的网站有哪些
  • 网站推广公司兴田德润紧急网页升级紧急通知
  • 厦门做网站哪家强企业网站网页设计的步骤
  • 普拓网站建设济南行业网站建设
  • 燕郊 网站开发网站里的地图定位怎么做
  • 门户网站建设招标互联网创业项目概述
  • 用什么做网站比较好市场调研公司是做什么的
  • 电商网站充值消费系统绍兴网站优化
  • 深圳网站建设公司联虚拟币交易网站开发
  • 专业网站设计建设公司抖音代运营公司排名前十强
  • 做网站架构肃北蒙古族自治县建设局网站
  • 推广网站怎么建经济研究院网站建设方案
  • 网站建设商家淘宝客自建网站做还是用微信qq做
  • django做网站效率高吗涉县移动网站建设报价
  • 做外贸网站注册什么邮箱能够做渗透的网站
  • 购物网站 怎么做织梦网站会员功能
  • 北京市网站开发公司郑州联通网站备案