Skip to content

Commit c1606c5

Browse files
committed
Polishing
1 parent 95fac25 commit c1606c5

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -103,6 +103,11 @@ protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry) {
103103
}
104104

105105

106+
/**
107+
* Return the bean factory to register the bean definitions with.
108+
* <p>The factory is exposed through the BeanDefinitionRegistry interface,
109+
* encapsulating the methods that are relevant for bean definition handling.
110+
*/
106111
public final BeanDefinitionRegistry getBeanFactory() {
107112
return this.registry;
108113
}

spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,15 +22,15 @@
2222
import org.springframework.lang.Nullable;
2323

2424
/**
25-
* Simple interface for bean definition readers.
26-
* Specifies load methods with Resource and String location parameters.
25+
* Simple interface for bean definition readers that specifies load methods with
26+
* {@link Resource} and {@link String} location parameters.
2727
*
2828
* <p>Concrete bean definition readers can of course add additional
2929
* load and register methods for bean definitions, specific to
3030
* their bean definition format.
3131
*
3232
* <p>Note that a bean definition reader does not have to implement
33-
* this interface. It only serves as suggestion for bean definition
33+
* this interface. It only serves as a suggestion for bean definition
3434
* readers that want to follow standard naming conventions.
3535
*
3636
* @author Juergen Hoeller
@@ -41,25 +41,25 @@ public interface BeanDefinitionReader {
4141

4242
/**
4343
* Return the bean factory to register the bean definitions with.
44-
* <p>The factory is exposed through the BeanDefinitionRegistry interface,
44+
* <p>The factory is exposed through the {@link BeanDefinitionRegistry} interface,
4545
* encapsulating the methods that are relevant for bean definition handling.
4646
*/
4747
BeanDefinitionRegistry getRegistry();
4848

4949
/**
50-
* Return the resource loader to use for resource locations.
51-
* Can be checked for the <b>ResourcePatternResolver</b> interface and cast
50+
* Return the {@link ResourceLoader} to use for resource locations.
51+
* <p>Can be checked for the {@code ResourcePatternResolver} interface and cast
5252
* accordingly, for loading multiple resources for a given resource pattern.
5353
* <p>A {@code null} return value suggests that absolute resource loading
5454
* is not available for this bean definition reader.
5555
* <p>This is mainly meant to be used for importing further resources
5656
* from within a bean definition resource, for example via the "import"
5757
* tag in XML bean definitions. It is recommended, however, to apply
5858
* such imports relative to the defining resource; only explicit full
59-
* resource locations will trigger absolute resource loading.
59+
* resource locations will trigger absolute path based resource loading.
6060
* <p>There is also a {@code loadBeanDefinitions(String)} method available,
6161
* for loading bean definitions from a resource location (or location pattern).
62-
* This is a convenience to avoid explicit ResourceLoader handling.
62+
* This is a convenience to avoid explicit {@code ResourceLoader} handling.
6363
* @see #loadBeanDefinitions(String)
6464
* @see org.springframework.core.io.support.ResourcePatternResolver
6565
*/
@@ -70,13 +70,13 @@ public interface BeanDefinitionReader {
7070
* Return the class loader to use for bean classes.
7171
* <p>{@code null} suggests to not load bean classes eagerly
7272
* but rather to just register bean definitions with class names,
73-
* with the corresponding Classes to be resolved later (or never).
73+
* with the corresponding classes to be resolved later (or never).
7474
*/
7575
@Nullable
7676
ClassLoader getBeanClassLoader();
7777

7878
/**
79-
* Return the BeanNameGenerator to use for anonymous beans
79+
* Return the {@link BeanNameGenerator} to use for anonymous beans
8080
* (without explicit bean name specified).
8181
*/
8282
BeanNameGenerator getBeanNameGenerator();
@@ -101,9 +101,10 @@ public interface BeanDefinitionReader {
101101
/**
102102
* Load bean definitions from the specified resource location.
103103
* <p>The location can also be a location pattern, provided that the
104-
* ResourceLoader of this bean definition reader is a ResourcePatternResolver.
105-
* @param location the resource location, to be loaded with the ResourceLoader
106-
* (or ResourcePatternResolver) of this bean definition reader
104+
* {@link ResourceLoader} of this bean definition reader is a
105+
* {@code ResourcePatternResolver}.
106+
* @param location the resource location, to be loaded with the {@code ResourceLoader}
107+
* (or {@code ResourcePatternResolver}) of this bean definition reader
107108
* @return the number of bean definitions found
108109
* @throws BeanDefinitionStoreException in case of loading or parsing errors
109110
* @see #getResourceLoader()
@@ -114,8 +115,8 @@ public interface BeanDefinitionReader {
114115

115116
/**
116117
* Load bean definitions from the specified resource locations.
117-
* @param locations the resource locations, to be loaded with the ResourceLoader
118-
* (or ResourcePatternResolver) of this bean definition reader
118+
* @param locations the resource locations, to be loaded with the {@code ResourceLoader}
119+
* (or {@code ResourcePatternResolver}) of this bean definition reader
119120
* @return the number of bean definitions found
120121
* @throws BeanDefinitionStoreException in case of loading or parsing errors
121122
*/

0 commit comments

Comments
 (0)