Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
762ea3ea
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
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,发现更多精彩内容 >>
提交
762ea3ea
编写于
8月 01, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Document all remaining public methods on BeanDefinitionParserDelegate
Closes gh-23349
上级
871bb57e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
64 addition
and
12 deletion
+64
-12
spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
...ework/beans/factory/xml/BeanDefinitionParserDelegate.java
+64
-12
未找到文件。
spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
浏览文件 @
762ea3ea
...
@@ -643,6 +643,9 @@ public class BeanDefinitionParserDelegate {
...
@@ -643,6 +643,9 @@ public class BeanDefinitionParserDelegate {
parentName
,
className
,
this
.
readerContext
.
getBeanClassLoader
());
parentName
,
className
,
this
.
readerContext
.
getBeanClassLoader
());
}
}
/**
* Parse the meta elements underneath the given element, if any.
*/
public
void
parseMetaElements
(
Element
ele
,
BeanMetadataAttributeAccessor
attributeAccessor
)
{
public
void
parseMetaElements
(
Element
ele
,
BeanMetadataAttributeAccessor
attributeAccessor
)
{
NodeList
nl
=
ele
.
getChildNodes
();
NodeList
nl
=
ele
.
getChildNodes
();
for
(
int
i
=
0
;
i
<
nl
.
getLength
();
i
++)
{
for
(
int
i
=
0
;
i
<
nl
.
getLength
();
i
++)
{
...
@@ -658,23 +661,27 @@ public class BeanDefinitionParserDelegate {
...
@@ -658,23 +661,27 @@ public class BeanDefinitionParserDelegate {
}
}
}
}
/**
* Parse the given autowire attribute value into
* {@link AbstractBeanDefinition} autowire constants.
*/
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
int
getAutowireMode
(
String
attValue
)
{
public
int
getAutowireMode
(
String
att
r
Value
)
{
String
att
=
att
Value
;
String
att
r
=
attr
Value
;
if
(
isDefaultValue
(
att
))
{
if
(
isDefaultValue
(
att
r
))
{
att
=
this
.
defaults
.
getAutowire
();
att
r
=
this
.
defaults
.
getAutowire
();
}
}
int
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_NO
;
int
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_NO
;
if
(
AUTOWIRE_BY_NAME_VALUE
.
equals
(
att
))
{
if
(
AUTOWIRE_BY_NAME_VALUE
.
equals
(
att
r
))
{
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_BY_NAME
;
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_BY_NAME
;
}
}
else
if
(
AUTOWIRE_BY_TYPE_VALUE
.
equals
(
att
))
{
else
if
(
AUTOWIRE_BY_TYPE_VALUE
.
equals
(
att
r
))
{
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_BY_TYPE
;
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_BY_TYPE
;
}
}
else
if
(
AUTOWIRE_CONSTRUCTOR_VALUE
.
equals
(
att
))
{
else
if
(
AUTOWIRE_CONSTRUCTOR_VALUE
.
equals
(
att
r
))
{
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_CONSTRUCTOR
;
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_CONSTRUCTOR
;
}
}
else
if
(
AUTOWIRE_AUTODETECT_VALUE
.
equals
(
att
))
{
else
if
(
AUTOWIRE_AUTODETECT_VALUE
.
equals
(
att
r
))
{
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_AUTODETECT
;
autowire
=
AbstractBeanDefinition
.
AUTOWIRE_AUTODETECT
;
}
}
// Else leave default value.
// Else leave default value.
...
@@ -953,6 +960,12 @@ public class BeanDefinitionParserDelegate {
...
@@ -953,6 +960,12 @@ public class BeanDefinitionParserDelegate {
}
}
}
}
/**
* Parse a value, ref or collection sub-element of a property or
* constructor-arg element.
* @param ele subelement of property element; we don't know which yet
* @param bd the current bean definition (if any)
*/
@Nullable
@Nullable
public
Object
parsePropertySubElement
(
Element
ele
,
@Nullable
BeanDefinition
bd
)
{
public
Object
parsePropertySubElement
(
Element
ele
,
@Nullable
BeanDefinition
bd
)
{
return
parsePropertySubElement
(
ele
,
bd
,
null
);
return
parsePropertySubElement
(
ele
,
bd
,
null
);
...
@@ -962,6 +975,7 @@ public class BeanDefinitionParserDelegate {
...
@@ -962,6 +975,7 @@ public class BeanDefinitionParserDelegate {
* Parse a value, ref or collection sub-element of a property or
* Parse a value, ref or collection sub-element of a property or
* constructor-arg element.
* constructor-arg element.
* @param ele subelement of property element; we don't know which yet
* @param ele subelement of property element; we don't know which yet
* @param bd the current bean definition (if any)
* @param defaultValueType the default type (class name) for any
* @param defaultValueType the default type (class name) for any
* {@code <value>} tag that might be created
* {@code <value>} tag that might be created
*/
*/
...
@@ -1347,11 +1361,22 @@ public class BeanDefinitionParserDelegate {
...
@@ -1347,11 +1361,22 @@ public class BeanDefinitionParserDelegate {
return
TRUE_VALUE
.
equals
(
value
);
return
TRUE_VALUE
.
equals
(
value
);
}
}
/**
* Parse a custom element (outside of the default namespace).
* @param ele the element to parse
* @return the resulting bean definition
*/
@Nullable
@Nullable
public
BeanDefinition
parseCustomElement
(
Element
ele
)
{
public
BeanDefinition
parseCustomElement
(
Element
ele
)
{
return
parseCustomElement
(
ele
,
null
);
return
parseCustomElement
(
ele
,
null
);
}
}
/**
* Parse a custom element (outside of the default namespace).
* @param ele the element to parse
* @param containingBd the containing bean definition (if any)
* @return the resulting bean definition
*/
@Nullable
@Nullable
public
BeanDefinition
parseCustomElement
(
Element
ele
,
@Nullable
BeanDefinition
containingBd
)
{
public
BeanDefinition
parseCustomElement
(
Element
ele
,
@Nullable
BeanDefinition
containingBd
)
{
String
namespaceUri
=
getNamespaceURI
(
ele
);
String
namespaceUri
=
getNamespaceURI
(
ele
);
...
@@ -1366,14 +1391,27 @@ public class BeanDefinitionParserDelegate {
...
@@ -1366,14 +1391,27 @@ public class BeanDefinitionParserDelegate {
return
handler
.
parse
(
ele
,
new
ParserContext
(
this
.
readerContext
,
this
,
containingBd
));
return
handler
.
parse
(
ele
,
new
ParserContext
(
this
.
readerContext
,
this
,
containingBd
));
}
}
public
BeanDefinitionHolder
decorateBeanDefinitionIfRequired
(
Element
ele
,
BeanDefinitionHolder
definitionHolder
)
{
/**
return
decorateBeanDefinitionIfRequired
(
ele
,
definitionHolder
,
null
);
* Decorate the given bean definition through a namespace handler, if applicable.
* @param ele the current element
* @param originalDef the current bean definition
* @return the decorated bean definition
*/
public
BeanDefinitionHolder
decorateBeanDefinitionIfRequired
(
Element
ele
,
BeanDefinitionHolder
originalDef
)
{
return
decorateBeanDefinitionIfRequired
(
ele
,
originalDef
,
null
);
}
}
/**
* Decorate the given bean definition through a namespace handler, if applicable.
* @param ele the current element
* @param originalDef the current bean definition
* @param containingBd the containing bean definition (if any)
* @return the decorated bean definition
*/
public
BeanDefinitionHolder
decorateBeanDefinitionIfRequired
(
public
BeanDefinitionHolder
decorateBeanDefinitionIfRequired
(
Element
ele
,
BeanDefinitionHolder
definitionHolder
,
@Nullable
BeanDefinition
containingBd
)
{
Element
ele
,
BeanDefinitionHolder
originalDef
,
@Nullable
BeanDefinition
containingBd
)
{
BeanDefinitionHolder
finalDefinition
=
definitionHolder
;
BeanDefinitionHolder
finalDefinition
=
originalDef
;
// Decorate based on custom attributes first.
// Decorate based on custom attributes first.
NamedNodeMap
attributes
=
ele
.
getAttributes
();
NamedNodeMap
attributes
=
ele
.
getAttributes
();
...
@@ -1393,6 +1431,14 @@ public class BeanDefinitionParserDelegate {
...
@@ -1393,6 +1431,14 @@ public class BeanDefinitionParserDelegate {
return
finalDefinition
;
return
finalDefinition
;
}
}
/**
* Decorate the given bean definition through a namespace handler,
* if applicable.
* @param node the current child node
* @param originalDef the current bean definition
* @param containingBd the containing bean definition (if any)
* @return the decorated bean definition
*/
public
BeanDefinitionHolder
decorateIfRequired
(
public
BeanDefinitionHolder
decorateIfRequired
(
Node
node
,
BeanDefinitionHolder
originalDef
,
@Nullable
BeanDefinition
containingBd
)
{
Node
node
,
BeanDefinitionHolder
originalDef
,
@Nullable
BeanDefinition
containingBd
)
{
...
@@ -1473,10 +1519,16 @@ public class BeanDefinitionParserDelegate {
...
@@ -1473,10 +1519,16 @@ public class BeanDefinitionParserDelegate {
return
desiredName
.
equals
(
node
.
getNodeName
())
||
desiredName
.
equals
(
getLocalName
(
node
));
return
desiredName
.
equals
(
node
.
getNodeName
())
||
desiredName
.
equals
(
getLocalName
(
node
));
}
}
/**
* Determine whether the given URI indicates the default namespace.
*/
public
boolean
isDefaultNamespace
(
@Nullable
String
namespaceUri
)
{
public
boolean
isDefaultNamespace
(
@Nullable
String
namespaceUri
)
{
return
(!
StringUtils
.
hasLength
(
namespaceUri
)
||
BEANS_NAMESPACE_URI
.
equals
(
namespaceUri
));
return
(!
StringUtils
.
hasLength
(
namespaceUri
)
||
BEANS_NAMESPACE_URI
.
equals
(
namespaceUri
));
}
}
/**
* Determine whether the given node indicates the default namespace.
*/
public
boolean
isDefaultNamespace
(
Node
node
)
{
public
boolean
isDefaultNamespace
(
Node
node
)
{
return
isDefaultNamespace
(
getNamespaceURI
(
node
));
return
isDefaultNamespace
(
getNamespaceURI
(
node
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录