diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/plugin/Extension.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/plugin/Extension.java deleted file mode 100644 index 6bb68f2ee7..0000000000 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/plugin/Extension.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2002-2008 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.config.java.plugin; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.core.Ordered; - - -/** - * TODO: JAVADOC - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.ANNOTATION_TYPE) -@Inherited -public @interface Extension { - /** - * The class that handles this plugin. - */ - // TODO: SJC-242 rename to handlerType / handlerClass - Class> handler(); - - /** - * The order in which this plugin will be processed relative to others. Per the - * semantics of {@link Ordered}, lower integer values will be treated as higher - * priority. - * - * @see Ordered - */ - int order() default 0; -} diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/plugin/ExtensionAnnotationBeanDefinitionRegistrar.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/plugin/ExtensionAnnotationBeanDefinitionRegistrar.java deleted file mode 100644 index ab7f8553b7..0000000000 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/plugin/ExtensionAnnotationBeanDefinitionRegistrar.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2002-2008 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.config.java.plugin; - -import java.lang.annotation.Annotation; - -import org.springframework.beans.factory.support.BeanDefinitionRegistry; - - -/** - * Registers bean definitions based on {@link Extension} metadata - */ -public interface ExtensionAnnotationBeanDefinitionRegistrar { - - /** - * - */ - void handle(A annotation, BeanDefinitionRegistry registry); -} diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AbstractConfigurationClassProcessor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AbstractConfigurationClassProcessor.java index 141d86de60..95bef486f0 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AbstractConfigurationClassProcessor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AbstractConfigurationClassProcessor.java @@ -22,8 +22,6 @@ import org.springframework.beans.factory.parsing.ProblemReporter; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.config.java.Bean; import org.springframework.config.java.Configuration; -import org.springframework.config.java.ConfigurationModel; -import org.springframework.config.java.internal.parsing.ConfigurationParser; /** diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/AbstractMethodInterceptor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AbstractMethodInterceptor.java similarity index 96% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/AbstractMethodInterceptor.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/AbstractMethodInterceptor.java index cde89a4aef..104fc56e43 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/AbstractMethodInterceptor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AbstractMethodInterceptor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.enhancement; +package org.springframework.config.java.support; import java.lang.reflect.Method; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/AddAnnotationAdapter.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AddAnnotationAdapter.java similarity index 98% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/AddAnnotationAdapter.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/AddAnnotationAdapter.java index 8bab9a9836..7e5a9c7ef3 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/AddAnnotationAdapter.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AddAnnotationAdapter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.enhancement; +package org.springframework.config.java.support; import net.sf.cglib.asm.Constants; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/AnnotationAdapter.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AnnotationAdapter.java similarity index 97% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/AnnotationAdapter.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/AnnotationAdapter.java index e7266ac0fe..9dcb38725c 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/AnnotationAdapter.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AnnotationAdapter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; import org.objectweb.asm.AnnotationVisitor; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/AsmUtils.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AsmUtils.java similarity index 97% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/AsmUtils.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/AsmUtils.java index 00cf0407d5..41e02e6cdc 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/AsmUtils.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/AsmUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; import java.io.IOException; import java.io.InputStream; @@ -22,7 +22,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.objectweb.asm.ClassReader; import org.objectweb.asm.commons.EmptyVisitor; -import org.springframework.config.java.Util; /** diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/BeanDefinitionRegistrar.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanDefinitionRegistrar.java similarity index 91% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/BeanDefinitionRegistrar.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanDefinitionRegistrar.java index 4de15092f4..8fbbd11f09 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/BeanDefinitionRegistrar.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanDefinitionRegistrar.java @@ -1,4 +1,4 @@ -package org.springframework.config.java; +package org.springframework.config.java.support; import java.lang.reflect.Method; @@ -19,7 +19,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; // TODO: SJC-242 document FactoryMethodHandler // TODO: SJC-242 odd that the api here uses both ModelMethod and java.lang.reflect.Member // TODO: SJC-242 document that there must be a no-arg ctor -public interface BeanDefinitionRegistrar { +interface BeanDefinitionRegistrar { /** * Determines whether this registrar is capable of handling method. diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/BeanMethod.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanMethod.java similarity index 98% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/BeanMethod.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanMethod.java index ddb4bdf495..d2d03e53ad 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/BeanMethod.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanMethod.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java; +package org.springframework.config.java.support; import static java.lang.String.*; import static org.springframework.config.java.StandardScopes.*; @@ -26,13 +26,14 @@ import java.util.List; import org.springframework.beans.factory.parsing.Location; import org.springframework.beans.factory.parsing.Problem; import org.springframework.beans.factory.parsing.ProblemReporter; +import org.springframework.config.java.Bean; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.core.io.FileSystemResource; import org.springframework.util.Assert; -public final class BeanMethod { +final class BeanMethod { private final String name; private final int modifiers; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/BeanMethodInterceptor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanMethodInterceptor.java similarity index 96% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/BeanMethodInterceptor.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanMethodInterceptor.java index c8d7d2b773..df5064f885 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/BeanMethodInterceptor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanMethodInterceptor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.enhancement; +package org.springframework.config.java.support; import static java.lang.String.*; @@ -23,7 +23,6 @@ import net.sf.cglib.proxy.MethodProxy; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.config.java.Bean; -import org.springframework.config.java.BeanRegistrar; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.core.annotation.AnnotationUtils; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/BeanRegistrar.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanRegistrar.java similarity index 98% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/BeanRegistrar.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanRegistrar.java index dbed9f0329..39756f7a8f 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/BeanRegistrar.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/BeanRegistrar.java @@ -1,4 +1,4 @@ -package org.springframework.config.java; +package org.springframework.config.java.support; import static java.lang.String.*; import static org.springframework.util.StringUtils.*; @@ -17,6 +17,7 @@ import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.config.java.Bean; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.core.annotation.AnnotationUtils; @@ -25,7 +26,7 @@ import org.springframework.util.Assert; // TODO: SJC-242 document BeanHandler // TODO: SJC-242 make package-private -public class BeanRegistrar implements BeanDefinitionRegistrar { +class BeanRegistrar implements BeanDefinitionRegistrar { private static final Log logger = LogFactory.getLog(BeanRegistrar.class); diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/ConfigurationClass.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClass.java similarity index 97% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/ConfigurationClass.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClass.java index a73dde096e..a7a6dcdd2b 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/ConfigurationClass.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClass.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java; +package org.springframework.config.java.support; import static java.lang.String.*; @@ -26,6 +26,7 @@ import java.util.Set; import org.springframework.beans.factory.parsing.Location; import org.springframework.beans.factory.parsing.Problem; import org.springframework.beans.factory.parsing.ProblemReporter; +import org.springframework.config.java.Configuration; import org.springframework.core.io.FileSystemResource; import org.springframework.util.Assert; @@ -48,9 +49,7 @@ import sun.security.x509.Extension; * * @author Chris Beams */ -// TODO: SJC-242 update documentation in light of generalization changes -// consider removing all refs to Bean, ExternalBean, etc. -public final class ConfigurationClass extends ModelClass { +final class ConfigurationClass extends ModelClass { private String beanName; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationClassMethodVisitor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassMethodVisitor.java similarity index 92% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationClassMethodVisitor.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassMethodVisitor.java index f4f1455be8..3f0222f2af 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationClassMethodVisitor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassMethodVisitor.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; -import static org.springframework.config.java.Util.*; -import static org.springframework.config.java.internal.parsing.AsmUtils.*; -import static org.springframework.config.java.internal.parsing.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.AsmUtils.*; +import static org.springframework.config.java.support.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.Util.*; import static org.springframework.util.ClassUtils.*; import java.lang.annotation.Annotation; @@ -29,10 +29,7 @@ import org.objectweb.asm.Label; import org.objectweb.asm.MethodAdapter; import org.objectweb.asm.Opcodes; import org.springframework.config.java.Bean; -import org.springframework.config.java.BeanMethod; import org.springframework.config.java.Configuration; -import org.springframework.config.java.ConfigurationClass; -import org.springframework.config.java.ModelClass; /** diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassPostProcessor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassPostProcessor.java index d045a4c19d..c6baf9dc41 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassPostProcessor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassPostProcessor.java @@ -29,9 +29,6 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.config.java.Bean; import org.springframework.config.java.Configuration; -import org.springframework.config.java.ConfigurationModel; -import org.springframework.config.java.internal.enhancement.ConfigurationEnhancer; -import org.springframework.config.java.internal.parsing.ConfigurationParser; import org.springframework.core.Ordered; import org.springframework.core.type.AnnotationMetadata; import org.springframework.core.type.classreading.MetadataReader; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationClassVisitor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassVisitor.java similarity index 94% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationClassVisitor.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassVisitor.java index 751ee94ee6..11c018b496 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationClassVisitor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationClassVisitor.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; -import static org.springframework.config.java.Util.*; -import static org.springframework.config.java.internal.parsing.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.Util.*; import static org.springframework.util.ClassUtils.*; import java.lang.annotation.Annotation; @@ -30,10 +30,6 @@ import org.objectweb.asm.ClassReader; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.springframework.config.java.Configuration; -import org.springframework.config.java.ConfigurationClass; -import org.springframework.config.java.ConfigurationModel; -import org.springframework.config.java.plugin.Extension; -import org.springframework.util.ClassUtils; /** @@ -130,8 +126,8 @@ class ConfigurationClassVisitor extends ClassAdapter { // return new ImportAnnotationVisitor(model); // } - // ------------------------------------- - // Detect @Plugin annotations + /* ------------------------------------- + // Detect @Extension annotations // ------------------------------------- PluginAnnotationDetectingClassVisitor classVisitor = new PluginAnnotationDetectingClassVisitor(classLoader); @@ -142,6 +138,7 @@ class ConfigurationClassVisitor extends ClassAdapter { if (!classVisitor.hasPluginAnnotation()) return super.visitAnnotation(annoTypeDesc, visible); + */ Class annoType = loadToolingSafeClass(annoTypeName, classLoader); @@ -153,6 +150,7 @@ class ConfigurationClassVisitor extends ClassAdapter { return new MutableAnnotationVisitor(pluginAnno, classLoader); } + /* Support for @Extension annotation processing private static class PluginAnnotationDetectingClassVisitor extends ClassAdapter { private boolean hasPluginAnnotation = false; private final Extension pluginAnnotation = createMutableAnnotation(Extension.class); @@ -180,6 +178,7 @@ class ConfigurationClassVisitor extends ClassAdapter { return pluginAnnotation; } } + */ /** * Delegates all {@link Configuration @Configuration} class method parsing to diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/ConfigurationEnhancer.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationEnhancer.java similarity index 95% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/ConfigurationEnhancer.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationEnhancer.java index 77f16a5018..03ad6b5105 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/enhancement/ConfigurationEnhancer.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationEnhancer.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.enhancement; +package org.springframework.config.java.support; import static java.lang.String.*; -import static org.springframework.config.java.Util.*; +import static org.springframework.config.java.support.Util.*; import static org.springframework.util.Assert.*; import java.lang.annotation.Annotation; @@ -39,9 +39,6 @@ import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.config.java.BeanDefinitionRegistrar; -import org.springframework.config.java.BeanMethod; -import org.springframework.config.java.BeanRegistrar; import org.springframework.config.java.Configuration; @@ -53,7 +50,7 @@ import org.springframework.config.java.Configuration; * * @author Chris Beams */ -public class ConfigurationEnhancer { +class ConfigurationEnhancer { private static final Log log = LogFactory.getLog(ConfigurationEnhancer.class); diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/ConfigurationModel.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationModel.java similarity index 95% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/ConfigurationModel.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationModel.java index 2fe2db831a..45a2de9d48 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/ConfigurationModel.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationModel.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java; +package org.springframework.config.java.support; import static java.lang.String.*; @@ -22,6 +22,7 @@ import java.util.ArrayList; import org.springframework.beans.factory.parsing.Location; import org.springframework.beans.factory.parsing.Problem; import org.springframework.beans.factory.parsing.ProblemReporter; +import org.springframework.config.java.Configuration; import org.springframework.core.io.FileSystemResource; @@ -30,7 +31,7 @@ import org.springframework.core.io.FileSystemResource; * An abstract representation of a set of user-provided "Configuration classes", usually but * not necessarily annotated with {@link Configuration @Configuration}. The model is * populated with a - * {@link org.springframework.config.java.internal.parsing.ConfigurationParser} + * {@link org.springframework.config.java.support.ConfigurationParser} * implementation which may be reflection-based or ASM-based. Once a model has been * populated, it can then be rendered out to a set of BeanDefinitions. The model provides an * important layer of indirection between the complexity of parsing a set of classes and the @@ -41,9 +42,9 @@ import org.springframework.core.io.FileSystemResource; *

* * @author Chris Beams - * @see org.springframework.config.java.internal.parsing.ConfigurationParser + * @see org.springframework.config.java.support.ConfigurationParser */ -public final class ConfigurationModel { +final class ConfigurationModel { /* list is used because order and collection equality matters. */ private final ArrayList configurationClasses = new ArrayList(); diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationModelBeanDefinitionReader.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationModelBeanDefinitionReader.java index 07c4bad512..d5df4db948 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationModelBeanDefinitionReader.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationModelBeanDefinitionReader.java @@ -25,12 +25,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry; import org.springframework.config.java.Bean; -import org.springframework.config.java.BeanMethod; -import org.springframework.config.java.BeanRegistrar; import org.springframework.config.java.Configuration; -import org.springframework.config.java.ConfigurationClass; -import org.springframework.config.java.ConfigurationModel; -import org.springframework.config.java.plugin.Extension; import org.springframework.core.io.Resource; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationParser.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationParser.java similarity index 91% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationParser.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationParser.java index 8161f3f1e1..eae57a5b9f 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/ConfigurationParser.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ConfigurationParser.java @@ -13,14 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; import org.objectweb.asm.ClassReader; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.config.java.Configuration; -import org.springframework.config.java.ConfigurationClass; -import org.springframework.config.java.ConfigurationModel; -import org.springframework.config.java.Util; import org.springframework.util.ClassUtils; @@ -33,7 +30,7 @@ import org.springframework.util.ClassUtils; * from the concern of registering {@link BeanDefinition} objects based on the content of * that model. * - * @see org.springframework.config.java.ConfigurationModel + * @see org.springframework.config.java.support.ConfigurationModel * @see org.springframework.config.java.support.ConfigurationModelBeanDefinitionReader * * @author Chris Beams diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/ModelClass.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ModelClass.java similarity index 96% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/ModelClass.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/ModelClass.java index 678260ebf4..26f25570d3 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/ModelClass.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/ModelClass.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java; +package org.springframework.config.java.support; import org.springframework.beans.BeanMetadataElement; +import org.springframework.config.java.Configuration; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -27,7 +28,7 @@ import org.springframework.util.ClassUtils; * @author Chris Beams */ // TODO: Consider eliminating in favor of just ConfigurationClass -public class ModelClass implements BeanMetadataElement { +class ModelClass implements BeanMetadataElement { private String name; private boolean isInterface; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotation.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotation.java similarity index 81% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotation.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotation.java index 6fc66f390e..377f72b56a 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotation.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; /** * Note: the visibility of this interface would be reduced to package-private save for an @@ -22,9 +22,8 @@ package org.springframework.config.java.internal.parsing; * two interfaces: this one, and whatever annotation is currently being parsed. The * restriction is that both interfaces may not be package-private if they are in separate * packages. In order to avoid unnecessarily restricting the visibility options for - * user-defined annotations, this interface becomes public. Because it is in the internal.* - * package, it won't pollute the public API, but developers should take caution not to use - * this annotation outside the internal.parsing package. + * user-defined annotations, this interface becomes public. Developers should take caution + * not to use this annotation outside this package. * * @author Chris Beams */ diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationArrayVisitor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationArrayVisitor.java similarity index 91% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationArrayVisitor.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationArrayVisitor.java index 536db2b863..3de8a35644 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationArrayVisitor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationArrayVisitor.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; -import static org.springframework.config.java.Util.*; -import static org.springframework.config.java.internal.parsing.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.Util.*; import java.lang.annotation.Annotation; import java.lang.reflect.Array; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationInvocationHandler.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationInvocationHandler.java similarity index 99% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationInvocationHandler.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationInvocationHandler.java index a89f3215f2..fef0de4c23 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationInvocationHandler.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationInvocationHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; import static java.lang.String.*; import static org.springframework.core.annotation.AnnotationUtils.*; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationUtils.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationUtils.java similarity index 96% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationUtils.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationUtils.java index da16ea5427..73b8562499 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationUtils.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; import java.lang.annotation.Annotation; import java.lang.reflect.Proxy; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationVisitor.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationVisitor.java similarity index 95% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationVisitor.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationVisitor.java index 7217faeb6d..4a8d6b889e 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/internal/parsing/MutableAnnotationVisitor.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/MutableAnnotationVisitor.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.config.java.internal.parsing; +package org.springframework.config.java.support; -import static org.springframework.config.java.Util.*; -import static org.springframework.config.java.internal.parsing.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.MutableAnnotationUtils.*; +import static org.springframework.config.java.support.Util.*; import java.lang.annotation.Annotation; import java.lang.reflect.Field; diff --git a/org.springframework.config.java/src/main/java/org/springframework/config/java/Util.java b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/Util.java similarity index 98% rename from org.springframework.config.java/src/main/java/org/springframework/config/java/Util.java rename to org.springframework.config.java/src/main/java/org/springframework/config/java/support/Util.java index 3e7823b202..659a6eb255 100644 --- a/org.springframework.config.java/src/main/java/org/springframework/config/java/Util.java +++ b/org.springframework.config.java/src/main/java/org/springframework/config/java/support/Util.java @@ -1,4 +1,4 @@ -package org.springframework.config.java; +package org.springframework.config.java.support; import static java.lang.String.*; import static org.springframework.util.ClassUtils.*; @@ -24,7 +24,7 @@ import sun.security.x509.Extension; // TODO: SJC-242 general - check tabs & spaces // TODO: SJC-242 general - check apache header // TODO: SJC-242 rename, repackage, document -public class Util { +class Util { private static final Log log = LogFactory.getLog(Util.class); diff --git a/org.springframework.config.java/src/test/java/test/feature/lifecycle/scoping/ScopingTests.java b/org.springframework.config.java/src/test/java/test/feature/lifecycle/scoping/ScopingTests.java index 8843958eb0..fcdaba3123 100644 --- a/org.springframework.config.java/src/test/java/test/feature/lifecycle/scoping/ScopingTests.java +++ b/org.springframework.config.java/src/test/java/test/feature/lifecycle/scoping/ScopingTests.java @@ -26,7 +26,6 @@ import org.springframework.aop.scope.ScopedObject; import org.springframework.beans.factory.parsing.BeanDefinitionParsingException; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.config.java.Bean; -import org.springframework.config.java.BeanRegistrar; import org.springframework.config.java.Configuration; import org.springframework.config.java.StandardScopes; import org.springframework.config.java.support.ConfigurationClassPostProcessor; @@ -145,7 +144,7 @@ public class ScopingTests { String beanName = "scopedProxyInterface"; - String scopedBeanName = BeanRegistrar.resolveHiddenScopedProxyBeanName(beanName); + String scopedBeanName = "scopedTarget." + beanName; // get hidden bean assertEquals(flag, spouse.getName()); @@ -179,7 +178,7 @@ public class ScopingTests { String beanName = "scopedProxyClass"; - String scopedBeanName = BeanRegistrar.resolveHiddenScopedProxyBeanName(beanName); + String scopedBeanName = "scopedTarget." + beanName; // get hidden bean assertEquals(flag, spouse.getName());