|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2012 the original author or authors. |
| 2 | + * Copyright 2002-2013 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
20 | 20 |
|
21 | 21 | import org.apache.commons.logging.Log;
|
22 | 22 | import org.apache.commons.logging.LogFactory;
|
| 23 | + |
23 | 24 | import org.springframework.beans.factory.config.BeanDefinition;
|
24 | 25 | import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
25 | 26 | import org.springframework.core.Conventions;
|
|
37 | 38 | */
|
38 | 39 | abstract class ConfigurationClassUtils {
|
39 | 40 |
|
40 |
| - private static final Log logger = LogFactory.getLog(ConfigurationClassUtils.class); |
41 |
| - |
42 | 41 | private static final String CONFIGURATION_CLASS_FULL = "full";
|
43 | 42 |
|
44 | 43 | private static final String CONFIGURATION_CLASS_LITE = "lite";
|
45 | 44 |
|
46 | 45 | private static final String CONFIGURATION_CLASS_ATTRIBUTE =
|
47 |
| - Conventions.getQualifiedAttributeName(ConfigurationClassPostProcessor.class, "configurationClass"); |
| 46 | + Conventions.getQualifiedAttributeName(ConfigurationClassPostProcessor.class, "configurationClass"); |
| 47 | + |
| 48 | + private static final Log logger = LogFactory.getLog(ConfigurationClassUtils.class); |
48 | 49 |
|
49 | 50 |
|
50 | 51 | /**
|
@@ -93,20 +94,19 @@ else if (isLiteConfigurationCandidate(metadata)) {
|
93 | 94 | }
|
94 | 95 |
|
95 | 96 | public static boolean isConfigurationCandidate(AnnotationMetadata metadata) {
|
96 |
| - return isFullConfigurationCandidate(metadata) || isLiteConfigurationCandidate(metadata); |
| 97 | + return (isFullConfigurationCandidate(metadata) || isLiteConfigurationCandidate(metadata)); |
97 | 98 | }
|
98 | 99 |
|
99 | 100 | public static boolean isFullConfigurationCandidate(AnnotationMetadata metadata) {
|
100 | 101 | return metadata.isAnnotated(Configuration.class.getName());
|
101 | 102 | }
|
102 | 103 |
|
103 | 104 | public static boolean isLiteConfigurationCandidate(AnnotationMetadata metadata) {
|
104 |
| - return !metadata.isInterface() && // not an interface or an annotation |
105 |
| - (metadata.isAnnotated(Component.class.getName()) || |
106 |
| - metadata.hasAnnotatedMethods(Bean.class.getName())); |
| 105 | + // Do not consider an interface or an annotation... |
| 106 | + return (!metadata.isInterface() && ( |
| 107 | + metadata.isAnnotated(Component.class.getName()) || metadata.hasAnnotatedMethods(Bean.class.getName()))); |
107 | 108 | }
|
108 | 109 |
|
109 |
| - |
110 | 110 | /**
|
111 | 111 | * Determine whether the given bean definition indicates a full @Configuration class.
|
112 | 112 | */
|
|
0 commit comments