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

javaee spring 依赖注入之复杂类型的注入数组 集合 等

spring 依赖注入之复杂类型的注入

package com.test.pojo;import java.util.List;
import java.util.Map;
import java.util.Properties;/*** @description:* @projectName:testSpring* @see:com.test.pojo* @createTime:2023/8/27 14:39*/
public class AA {private int[] arr;private Drink[] drinkArr;private List<String> stringList;private List<Drink> drinkList;private Map<String,Drink> map;private Properties properties;public int[] getArr() {return arr;}public void setArr(int[] arr) {this.arr = arr;}public Drink[] getDrinkArr() {return drinkArr;}public void setDrinkArr(Drink[] drinkArr) {this.drinkArr = drinkArr;}public List<String> getStringList() {return stringList;}public void setStringList(List<String> stringList) {this.stringList = stringList;}public List<Drink> getDrinkList() {return drinkList;}public void setDrinkList(List<Drink> drinkList) {this.drinkList = drinkList;}public Map<String, Drink> getMap() {return map;}public void setMap(Map<String, Drink> map) {this.map = map;}public Properties getProperties() {return properties;}public void setProperties(Properties properties) {this.properties = properties;}
}
<bean id="aa" class="com.test.pojo.AA"><property name="arr"><array><value>1</value><value>2</value><value>3</value></array></property><property name="drinkArr"><array><ref bean="drink_01" /><ref bean="drink_02" /></array></property><property name="stringList"><list><value>tom</value><value>jack</value><value>tony</value></list></property><property name="drinkList"><list><ref bean="drink_01" /><ref bean="drink_02" /></list></property><property name="map"><map><entry key="first" value-ref="drink_01" /><entry key="second" value-ref="drink_02"  /></map></property><property name="properties"><props><prop key="driver" >com.mysql.jdbc.Driver</prop><prop key="url" >jdbc:mysql://localhost:3306/taobao</prop></props></property></bean>
http://www.lryc.cn/news/147537.html

相关文章:

  • [Android AIDL] --- AIDL工程搭建
  • 正中优配:回购!回购!再回购!已成A股新常态?
  • C# 多线程交替按照指定顺序执行
  • 【VLDB 2023】基于预测的云资源弹性伸缩框架MagicScaler,实现“高QoS,低成本”双丰收
  • Node爬虫项目精简版 wallhaven网站实操 2023.8.29
  • Vue统计图表的数据标签和数值显示技巧
  • Linux 虚拟机同步时间crontab以及crond详解
  • springmvc没有绿标,怎么配置tomcat插件运行?
  • 设计模式--模板方法模式(Template Method Pattern)
  • linux 权限管理命令
  • c++ qt--线程(一)(第八部分)
  • 参数初始化方法
  • Go的基础运行方式和打包
  • Deepin 图形化部署 Hadoop Single Node Cluster
  • 23款奔驰GLS400升级柏林之声音响系统,体验不一样的感觉
  • Vue的map()方法和filter()方法的使用
  • qt创建临时文件
  • Element——table排序,上移下移功能。及按钮上一条下一条功能
  • 无涯教程-Android - Linear Layout函数
  • ELK安装、部署、调试(六) logstash的安装和配置
  • 【Spring Security】UserDetails 接口介绍
  • C# Linq源码分析之Take(四)
  • Python 和 C++ 使用细节差别
  • 在Ubuntu Linux系统上安装RabbitMQ服务并解决公网远程访问问题
  • 葫芦娃自动预约-公众号代挂
  • ESP32应用教程(0)— PMW3901MB光流传感器
  • docker部署nginx,部署springboot项目,并实现访问
  • 十五、模板方法模式
  • jvm 什么是常量池,常量池定义 class常量池
  • CA证书颁发机构服务器