1.4.2.8. Compound Property Names(复合属性名)

 Spring Framework Documentation (5.3.10)

Core

IoC Container, Events, Resources, i18n, Validation, Data Binding, Type Conversion, SpEL, AOP.

   Core Technologies

1. The IoC Container

1.1. Introduction to the Spring IoC Container and Beans(Spring IoC容器和bean简介)

1.2. Container Overview (容器概览)

1.3. Bean Overview (Bean概览)

1.4. Dependencies(依赖)

1.4.1. Dependency Injection(依赖注入)

1.4.2. Dependencies and Configuration in Detail(依赖与配置详细介绍)

1.4.2.1. Straight Values (Primitives, Strings, and so on)(直接值(原始类型、字符串等))

1.4.2.2. References to Other Beans (Collaborators) (引用其他bean(协作者))

1.4.2.3. Inner Beans(内部bean)

1.4.2.4. Collections(集合)

1.4.2.5. Null and Empty String Values(Null和空字符串值)

1.4.2.6. XML Shortcut with the p-namespace(p命名空间的XML快捷方式)

1.4.2.7. XML Shortcut with the c-namespace(c-namespace的XML快捷方式)

1.4.2.8. Compound Property Names(复合属性名)

1.4.3. Using depends-on(使用depends-on)

1.4.4. Lazy-initialized Beans(延迟初始化Bean)

1.4.5. Autowiring Collaborators(自动装配协作者)

1.4.6. Method Injection(方法注入)

1.5. Bean Scopes(Bean作用域)


下载此文档精编完整版

 No.内容下载地址文档内容目录
1中英双语精编版 第一部分PDF下载内容目录
2中英双语精编版 第二部分PDF下载内容目录
3中文精编版 第一部分PDF下载内容目录
4中文精编版 第二部分PDF下载内容目录

更多章节内容,请点击查看:  Core Technologies


1.4.2.8. Compound Property Names(复合属性名)

You can use compound or nested property names when you set bean properties, as long as all components of the path except the final property name are not null. Consider the following bean definition:

设置bean属性时,可以使用复合属性名或嵌套属性名(compound or nested property name),只要路径的所有组件(最终属性名除外)都不为null。考虑下面的bean定义:

<bean id="something" class="things.ThingOne">
    <property name="fred.bob.sammy" value="123" />
</bean>

The something bean has a fred property, which has a bob property, which has a sammy property, and that final sammy property is being set to a value of 123. In order for this to work, the fred property of something and the bob property of fred must not be null after the bean is constructed. Otherwise, a NullPointerException is thrown.

something bean有一个fred属性,fred有一个bob属性,bob 有一个sammy属性,最终的sammy属性被设置为值123。为了使其工作,somethingfred属性和fredbob属性在构建bean后不能为null。否则,将抛出NullPointerException

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月满闲庭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值