Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dk131072
spring-framework
提交
5649f2f3
S
spring-framework
项目概览
dk131072
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5649f2f3
编写于
4月 10, 2009
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed generic registerCustomEditor signature
上级
20fc42ad
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
8 deletion
+10
-8
org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java
...amework/beans/factory/config/ConfigurableBeanFactory.java
+1
-1
org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
...gframework/beans/factory/support/AbstractBeanFactory.java
+9
-7
未找到文件。
org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java
浏览文件 @
5649f2f3
...
...
@@ -154,7 +154,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
* @param requiredType type of the property
* @param propertyEditorClass the {@link PropertyEditor} class to register
*/
void
registerCustomEditor
(
Class
requiredType
,
Class
<
PropertyEditor
>
propertyEditorClass
);
void
registerCustomEditor
(
Class
requiredType
,
Class
<
?
extends
PropertyEditor
>
propertyEditorClass
);
/**
* Initialize the given PropertyEditorRegistry with the custom editors
...
...
org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
浏览文件 @
5649f2f3
...
...
@@ -122,8 +122,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
private
TypeConverter
typeConverter
;
/** Custom PropertyEditors to apply to the beans of this factory */
private
final
Map
<
Class
,
Class
<
PropertyEditor
>>
customEditors
=
new
HashMap
<
Class
,
Class
<
PropertyEditor
>>(
4
);
private
final
Map
<
Class
,
Class
<
?
extends
PropertyEditor
>>
customEditors
=
new
HashMap
<
Class
,
Class
<
?
extends
PropertyEditor
>>(
4
);
/** String resolvers to apply e.g. to annotation attribute values */
private
final
List
<
StringValueResolver
>
embeddedValueResolvers
=
new
LinkedList
<
StringValueResolver
>();
...
...
@@ -213,7 +213,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
throws
BeansException
{
final
String
beanName
=
transformedBeanName
(
name
);
Object
bean
=
null
;
Object
bean
;
// Eagerly check singleton cache for manually registered singletons.
Object
sharedInstance
=
getSingleton
(
beanName
);
...
...
@@ -613,7 +613,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return
this
.
propertyEditorRegistrars
;
}
public
void
registerCustomEditor
(
Class
requiredType
,
Class
<
PropertyEditor
>
propertyEditorClass
)
{
public
void
registerCustomEditor
(
Class
requiredType
,
Class
<
?
extends
PropertyEditor
>
propertyEditorClass
)
{
Assert
.
notNull
(
requiredType
,
"Required type must not be null"
);
Assert
.
isAssignable
(
PropertyEditor
.
class
,
propertyEditorClass
);
this
.
customEditors
.
put
(
requiredType
,
propertyEditorClass
);
...
...
@@ -626,7 +626,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
/**
* Return the map of custom editors, with Classes as keys and PropertyEditor classes as values.
*/
public
Map
<
Class
,
Class
<
PropertyEditor
>>
getCustomEditors
()
{
public
Map
<
Class
,
Class
<
?
extends
PropertyEditor
>>
getCustomEditors
()
{
return
this
.
customEditors
;
}
...
...
@@ -795,6 +795,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @param beanName the name of the prototype about to be created
* @see #isPrototypeCurrentlyInCreation
*/
@SuppressWarnings
(
"unchecked"
)
protected
void
beforePrototypeCreation
(
String
beanName
)
{
Object
curVal
=
this
.
prototypesCurrentlyInCreation
.
get
();
if
(
curVal
==
null
)
{
...
...
@@ -818,6 +819,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @param beanName the name of the prototype that has been created
* @see #isPrototypeCurrentlyInCreation
*/
@SuppressWarnings
(
"unchecked"
)
protected
void
afterPrototypeCreation
(
String
beanName
)
{
Object
curVal
=
this
.
prototypesCurrentlyInCreation
.
get
();
if
(
curVal
instanceof
String
)
{
...
...
@@ -957,7 +959,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
if
(!
this
.
customEditors
.
isEmpty
())
{
for
(
Map
.
Entry
<
Class
,
Class
<
PropertyEditor
>>
entry
:
this
.
customEditors
.
entrySet
())
{
for
(
Map
.
Entry
<
Class
,
Class
<
?
extends
PropertyEditor
>>
entry
:
this
.
customEditors
.
entrySet
())
{
Class
requiredType
=
entry
.
getKey
();
Class
editorClass
=
entry
.
getValue
();
registry
.
registerCustomEditor
(
requiredType
,
...
...
@@ -1027,7 +1029,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
else
{
// Child bean definition: needs to be merged with parent.
BeanDefinition
pbd
=
null
;
BeanDefinition
pbd
;
try
{
String
parentBeanName
=
transformedBeanName
(
bd
.
getParentName
());
if
(!
beanName
.
equals
(
parentBeanName
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录