Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
7f96f573
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,体验更适合开发者的 AI 搜索 >>
提交
7f96f573
编写于
3月 23, 2009
作者:
C
Chris Beams
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polishing
上级
1284bd58
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
56 addition
and
26 deletion
+56
-26
org.springframework.context/src/main/java/org/springframework/context/annotation/Bean.java
...ain/java/org/springframework/context/annotation/Bean.java
+1
-5
org.springframework.context/src/main/java/org/springframework/context/annotation/Configuration.java
...org/springframework/context/annotation/Configuration.java
+1
-4
org.springframework.context/src/main/java/org/springframework/context/annotation/Import.java
...n/java/org/springframework/context/annotation/Import.java
+2
-1
org.springframework.context/src/main/java/org/springframework/context/annotation/Scope.java
...in/java/org/springframework/context/annotation/Scope.java
+1
-1
org.springframework.context/src/main/java/org/springframework/context/annotation/StandardScopes.java
...rg/springframework/context/annotation/StandardScopes.java
+2
-2
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AbstractConfigurationClassProcessor.java
...notation/support/AbstractConfigurationClassProcessor.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AddAnnotationAdapter.java
...work/context/annotation/support/AddAnnotationAdapter.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AnnotationAdapter.java
...amework/context/annotation/support/AnnotationAdapter.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AsmUtils.java
.../springframework/context/annotation/support/AsmUtils.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/BeanMethod.java
...pringframework/context/annotation/support/BeanMethod.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/BeanMethodInterceptor.java
...ork/context/annotation/support/BeanMethodInterceptor.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClass.java
...mework/context/annotation/support/ConfigurationClass.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClassMethodVisitor.java
...t/annotation/support/ConfigurationClassMethodVisitor.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClassPostProcessor.java
...t/annotation/support/ConfigurationClassPostProcessor.java
+2
-1
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClassVisitor.java
...context/annotation/support/ConfigurationClassVisitor.java
+3
-2
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationEnhancer.java
...ork/context/annotation/support/ConfigurationEnhancer.java
+1
-1
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationModel.java
...mework/context/annotation/support/ConfigurationModel.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationModelBeanDefinitionReader.java
...ation/support/ConfigurationModelBeanDefinitionReader.java
+5
-6
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationParser.java
...ework/context/annotation/support/ConfigurationParser.java
+2
-1
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ImportAnnotationVisitor.java
...k/context/annotation/support/ImportAnnotationVisitor.java
+2
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ImportStack.java
...ringframework/context/annotation/support/ImportStack.java
+1
-1
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ImportStackHolder.java
...amework/context/annotation/support/ImportStackHolder.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ModelClass.java
...pringframework/context/annotation/support/ModelClass.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotation.java
...amework/context/annotation/support/MutableAnnotation.java
+17
-1
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationArrayVisitor.java
...ext/annotation/support/MutableAnnotationArrayVisitor.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationInvocationHandler.java
...nnotation/support/MutableAnnotationInvocationHandler.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationUtils.java
...rk/context/annotation/support/MutableAnnotationUtils.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationVisitor.java
.../context/annotation/support/MutableAnnotationVisitor.java
+1
-0
org.springframework.context/src/main/java/org/springframework/context/annotation/support/Util.java
.../org/springframework/context/annotation/support/Util.java
+1
-0
未找到文件。
org.springframework.context/src/main/java/org/springframework/context/annotation/Bean.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation
;
import
java.lang.annotation.Documented
;
...
...
@@ -96,8 +97,3 @@ public @interface Bean {
String
[]
dependsOn
()
default
{};
}
// TODO: test @Lazy @Bean
// TODO: test @Primary @Bean
// TODO: test init/destroy method scenarios
// TODO: test dependsOn
org.springframework.context/src/main/java/org/springframework/context/annotation/Configuration.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation
;
import
java.lang.annotation.Documented
;
...
...
@@ -64,7 +65,3 @@ import org.springframework.stereotype.Component;
public
@interface
Configuration
{
}
// TODO: test @Configuration constructor autowiring
// TODO: test @Lazy @Configuration
org.springframework.context/src/main/java/org/springframework/context/annotation/Import.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation
;
import
java.lang.annotation.Documented
;
...
...
@@ -42,5 +43,5 @@ public @interface Import {
/**
* The {@link Configuration} class or classes to import.
*/
Class
<?>[]
value
();
Class
<?>[]
value
();
}
org.springframework.context/src/main/java/org/springframework/context/annotation/Scope.java
浏览文件 @
7f96f573
...
...
@@ -67,5 +67,5 @@ public @interface Scope {
* only in conjunction with a non-singleton, non-prototype {@link #value()}.
*/
ScopedProxyMode
proxyMode
()
default
ScopedProxyMode
.
NO
;
}
org.springframework.context/src/main/java/org/springframework/context/annotation/StandardScopes.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation
;
...
...
@@ -25,6 +26,7 @@ package org.springframework.context.annotation;
*
* @author Chris Beams
* @since 3.0
* @see Scope
*/
public
class
StandardScopes
{
...
...
@@ -39,5 +41,3 @@ public class StandardScopes {
public
static
final
String
SESSION
=
"session"
;
}
// TODO: move StandardScopes to appropriate package
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AbstractConfigurationClassProcessor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
org.springframework.beans.factory.config.BeanDefinition
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AddAnnotationAdapter.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
net.sf.cglib.asm.Constants
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AnnotationAdapter.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
org.springframework.asm.AnnotationVisitor
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/AsmUtils.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
java.io.IOException
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/BeanMethod.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/BeanMethodInterceptor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClass.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClassMethodVisitor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
org
.
springframework
.
context
.
annotation
.
support
.
AsmUtils
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClassPostProcessor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
@@ -146,7 +147,7 @@ public class ConfigurationClassPostProcessor extends AbstractConfigurationClassP
ConfigurationEnhancer
enhancer
=
new
ConfigurationEnhancer
(
beanFactory
);
for
(
String
beanName
:
configBeanDefs
.
getBeanDefinitionNames
())
{
for
(
String
beanName
:
configBeanDefs
.
getBeanDefinitionNames
())
{
BeanDefinition
beanDef
=
beanFactory
.
getBeanDefinition
(
beanName
);
String
configClassName
=
beanDef
.
getBeanClassName
();
String
enhancedClassName
=
enhancer
.
enhance
(
configClassName
);
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationClassVisitor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
@@ -144,8 +145,8 @@ class ConfigurationClassVisitor extends ClassAdapter {
* {@link ConfigurationClassMethodVisitor}.
*/
@Override
public
MethodVisitor
visitMethod
(
int
modifiers
,
String
methodName
,
String
methodDescriptor
,
String
arg3
,
String
[]
arg4
)
{
public
MethodVisitor
visitMethod
(
int
modifiers
,
String
methodName
,
String
methodDescriptor
,
String
arg3
,
String
[]
arg4
)
{
return
new
ConfigurationClassMethodVisitor
(
configClass
,
methodName
,
methodDescriptor
,
modifiers
,
classLoader
);
}
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationEnhancer.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
@@ -141,7 +142,6 @@ class ConfigurationEnhancer {
* @return original subclass instance unless superclass is annnotated with @Aspect, in
* which case a subclass of the subclass is returned
*/
// TODO: try to implement with modifications to AbstractAspectJAdvisorFactory#isAspect
private
Class
<?>
nestOneClassDeeperIfAspect
(
Class
<?>
superclass
,
Class
<?>
origSubclass
)
{
boolean
superclassIsAnAspect
=
false
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationModel.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationModelBeanDefinitionReader.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
@@ -63,10 +64,11 @@ class ConfigurationModelBeanDefinitionReader {
/**
* Reads {@code
model}, registering bean definitions with {@link #registry} based on
* its contents.
* Reads {@code
configurationModel}, registering bean definitions with {@link #registry}
*
based on
its contents.
*
* @return number of bean definitions generated
* @return new {@link BeanDefinitionRegistry} containing {@link BeanDefinition}s read
* from the model.
*/
public
BeanDefinitionRegistry
loadBeanDefinitions
(
ConfigurationModel
configurationModel
)
{
registry
=
new
SimpleBeanDefinitionRegistry
();
...
...
@@ -131,9 +133,6 @@ class ConfigurationModelBeanDefinitionReader {
Bean
bean
=
method
.
getRequiredAnnotation
(
Bean
.
class
);
// TODO: prune defaults
//Configuration defaults = configClass.getMetadata();
// consider scoping
Scope
scope
=
method
.
getAnnotation
(
Scope
.
class
);
if
(
scope
!=
null
)
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ConfigurationParser.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
org.springframework.asm.ClassReader
;
...
...
@@ -67,7 +68,7 @@ public class ConfigurationParser {
* that this configuration class was configured via XML)
*/
public
void
parse
(
String
className
,
String
configurationId
)
{
String
resourcePath
=
ClassUtils
.
convertClassNameToResourcePath
(
className
);
ClassReader
configClassReader
=
AsmUtils
.
newClassReader
(
Util
.
getClassAsStream
(
resourcePath
,
classLoader
));
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ImportAnnotationVisitor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
@@ -41,6 +42,7 @@ import org.springframework.util.Assert;
* @see ConfigurationClassVisitor
*/
class
ImportAnnotationVisitor
extends
AnnotationAdapter
{
private
final
ArrayList
<
String
>
classesToImport
=
new
ArrayList
<
String
>();
private
final
ConfigurationModel
model
;
private
final
ProblemReporter
problemReporter
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ImportStack.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
java.util.Collections
;
...
...
@@ -71,7 +72,6 @@ class ImportStack extends Stack<ConfigurationClass> {
StringBuilder
builder
=
new
StringBuilder
();
Iterator
<
ConfigurationClass
>
iterator
=
this
.
iterator
();
while
(
iterator
.
hasNext
())
{
builder
.
append
(
iterator
.
next
().
getSimpleName
());
if
(
iterator
.
hasNext
())
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ImportStackHolder.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
org.springframework.context.annotation.Import
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/ModelClass.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
org
.
springframework
.
util
.
ClassUtils
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotation.java
浏览文件 @
7f96f573
...
...
@@ -13,10 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
org.springframework.context.annotation.Configuration
;
/**
* Note: the visibility of this interface would be reduced to package-private save for an
* Interface used when dynamically creating mutable instances of annotations associated
* with {@link Configuration} class processing. This functionality is necessary given
* that parsing of Configuration classes is done with ASM. Annotation metadata (including
* attributes) is parsed from the classfiles, and instances of those annotations are
* then created using this interface and its associated utilities. The annotation
* instances are attached to the {@link ConfigurationModel} objects at runtime, namely
* {@link BeanMethod}. This approach is better than the alternative of creating fine-grained
* model representations of all annotations and attributes. It is better to simply attach
* annotation instances and read them as needed.
*
* <p>Note: the visibility of this interface would be reduced to package-private save for an
* obscure restriction of JDK dynamic proxies.
* {@link MutableAnnotationUtils#createMutableAnnotation(Class)} creates a proxy based on
* two interfaces: this one, and whatever annotation is currently being parsed. The
...
...
@@ -26,6 +39,9 @@ package org.springframework.context.annotation.support;
* not to use this annotation outside this package.
*
* @author Chris Beams
* @see MutableAnnotationUtils
* @see MutableAnnotationVisitor
* @see MutableAnnotationInvocationHandler
*/
public
interface
MutableAnnotation
{
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationArrayVisitor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
org
.
springframework
.
context
.
annotation
.
support
.
MutableAnnotationUtils
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationInvocationHandler.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationUtils.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
java.lang.annotation.Annotation
;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/MutableAnnotationVisitor.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
org
.
springframework
.
context
.
annotation
.
support
.
MutableAnnotationUtils
.*;
...
...
org.springframework.context/src/main/java/org/springframework/context/annotation/support/Util.java
浏览文件 @
7f96f573
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.context.annotation.support
;
import
static
java
.
lang
.
String
.*;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录