Browse Source

Rename ConfigurationClassMethod => BeanMethod

pull/7/head
Chris Beams 14 years ago
parent
commit
0a790c143f
  1. 4
      org.springframework.context/src/main/java/org/springframework/context/annotation/BeanMethod.java
  2. 22
      org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClass.java
  3. 6
      org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java
  4. 4
      org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

4
org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassMethod.java → org.springframework.context/src/main/java/org/springframework/context/annotation/BeanMethod.java

@ -31,14 +31,14 @@ import org.springframework.core.type.MethodMetadata; @@ -31,14 +31,14 @@ import org.springframework.core.type.MethodMetadata;
* @see ConfigurationClassParser
* @see ConfigurationClassBeanDefinitionReader
*/
final class ConfigurationClassMethod {
final class BeanMethod {
private final MethodMetadata metadata;
private final ConfigurationClass configurationClass;
public ConfigurationClassMethod(MethodMetadata metadata, ConfigurationClass configurationClass) {
public BeanMethod(MethodMetadata metadata, ConfigurationClass configurationClass) {
this.metadata = metadata;
this.configurationClass = configurationClass;
}

22
org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClass.java

@ -40,7 +40,7 @@ import org.springframework.util.ClassUtils; @@ -40,7 +40,7 @@ import org.springframework.util.ClassUtils;
* @author Chris Beams
* @author Juergen Hoeller
* @since 3.0
* @see ConfigurationClassMethod
* @see BeanMethod
* @see ConfigurationClassParser
*/
final class ConfigurationClass {
@ -51,7 +51,7 @@ final class ConfigurationClass { @@ -51,7 +51,7 @@ final class ConfigurationClass {
private final Map<String, Class<?>> importedResources = new LinkedHashMap<String, Class<?>>();
private final Set<ConfigurationClassMethod> methods = new LinkedHashSet<ConfigurationClassMethod>();
private final Set<BeanMethod> beanMethods = new LinkedHashSet<BeanMethod>();
private String beanName;
@ -89,12 +89,12 @@ final class ConfigurationClass { @@ -89,12 +89,12 @@ final class ConfigurationClass {
return this.beanName;
}
public void addMethod(ConfigurationClassMethod method) {
this.methods.add(method);
public void addBeanMethod(BeanMethod method) {
this.beanMethods.add(method);
}
public Set<ConfigurationClassMethod> getMethods() {
return this.methods;
public Set<BeanMethod> getBeanMethods() {
return this.beanMethods;
}
public void addImportedResource(String importedResource, Class<?> readerClass) {
@ -110,9 +110,9 @@ final class ConfigurationClass { @@ -110,9 +110,9 @@ final class ConfigurationClass {
// @Configuration class may declare two @Bean methods with the same name.
final char hashDelim = '#';
Map<String, Integer> methodNameCounts = new HashMap<String, Integer>();
for (ConfigurationClassMethod method : methods) {
String dClassName = method.getMetadata().getDeclaringClassName();
String methodName = method.getMetadata().getMethodName();
for (BeanMethod beanMethod : beanMethods) {
String dClassName = beanMethod.getMetadata().getDeclaringClassName();
String methodName = beanMethod.getMetadata().getMethodName();
String fqMethodName = dClassName + hashDelim + methodName;
Integer currentCount = methodNameCounts.get(fqMethodName);
int newCount = currentCount != null ? currentCount + 1 : 1;
@ -134,8 +134,8 @@ final class ConfigurationClass { @@ -134,8 +134,8 @@ final class ConfigurationClass {
}
}
for (ConfigurationClassMethod method : this.methods) {
method.validate(problemReporter);
for (BeanMethod beanMethod : this.beanMethods) {
beanMethod.validate(problemReporter);
}
}

6
org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java

@ -139,7 +139,7 @@ public class ConfigurationClassBeanDefinitionReader { @@ -139,7 +139,7 @@ public class ConfigurationClassBeanDefinitionReader {
AnnotationMetadata metadata = configClass.getMetadata();
processFeatureAnnotations(metadata);
doLoadBeanDefinitionForConfigurationClassIfNecessary(configClass);
for (ConfigurationClassMethod beanMethod : configClass.getMethods()) {
for (BeanMethod beanMethod : configClass.getBeanMethods()) {
loadBeanDefinitionsForBeanMethod(beanMethod);
}
loadBeanDefinitionsFromImportedResources(configClass.getImportedResources());
@ -200,10 +200,10 @@ public class ConfigurationClassBeanDefinitionReader { @@ -200,10 +200,10 @@ public class ConfigurationClassBeanDefinitionReader {
}
/**
* Read a particular {@link ConfigurationClassMethod}, registering bean definitions
* Read a particular {@link BeanMethod}, registering bean definitions
* with the BeanDefinitionRegistry based on its contents.
*/
private void loadBeanDefinitionsForBeanMethod(ConfigurationClassMethod beanMethod) {
private void loadBeanDefinitionsForBeanMethod(BeanMethod beanMethod) {
ConfigurationClass configClass = beanMethod.getConfigurationClass();
MethodMetadata metadata = beanMethod.getMetadata();

4
org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

@ -150,8 +150,8 @@ class ConfigurationClassParser { @@ -150,8 +150,8 @@ class ConfigurationClassParser {
}
}
Set<MethodMetadata> beanMethods = metadata.getAnnotatedMethods(Bean.class.getName());
for (MethodMetadata beanMethod : beanMethods) {
configClass.addMethod(new ConfigurationClassMethod(beanMethod, configClass));
for (MethodMetadata methodMetadata : beanMethods) {
configClass.addBeanMethod(new BeanMethod(methodMetadata, configClass));
}
}

Loading…
Cancel
Save