#53 - Polishing.
This commit is contained in:
@@ -25,7 +25,7 @@ import org.springframework.util.Assert;
|
||||
/**
|
||||
* Base class for {@link PluginRegistry} implementations. Implements an initialization mechanism triggered on forst
|
||||
* invocation of {@link #getPlugins()}.
|
||||
*
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public abstract class PluginRegistrySupport<T extends Plugin<S>, S> implements PluginRegistry<T, S>, Iterable<T> {
|
||||
@@ -35,7 +35,7 @@ public abstract class PluginRegistrySupport<T extends Plugin<S>, S> implements P
|
||||
|
||||
/**
|
||||
* Creates a new {@link PluginRegistrySupport} instance using the given plugins.
|
||||
*
|
||||
*
|
||||
* @param plugins must not be {@literal null}.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -51,7 +51,7 @@ public abstract class PluginRegistrySupport<T extends Plugin<S>, S> implements P
|
||||
* Returns all registered plugins. Only use this method if you really need to access all plugins. For distinguished
|
||||
* access to certain plugins favour accessor methods like {link #getPluginFor} over this one. This method should only
|
||||
* be used for testing purposes to check registry configuration.
|
||||
*
|
||||
*
|
||||
* @return all plugins of the registry
|
||||
*/
|
||||
public List<T> getPlugins() {
|
||||
@@ -67,7 +67,7 @@ public abstract class PluginRegistrySupport<T extends Plugin<S>, S> implements P
|
||||
/**
|
||||
* Callback to initialize the plugin {@link List}. Will create a defensive copy of the {@link List} to potentially
|
||||
* unwrap a {@link List} proxy. Will filter {@literal null} values from the source list as well.
|
||||
*
|
||||
*
|
||||
* @param plugins must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
@@ -80,7 +80,7 @@ public abstract class PluginRegistrySupport<T extends Plugin<S>, S> implements P
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
|
||||
* {@link ImportBeanDefinitionRegistrar} to register {@link PluginRegistryFactoryBean} instances for type listed in
|
||||
* {@link EnablePluginRegistries}. Picks up {@link Qualifier} annotations used on the plugin interface and forwards them
|
||||
* to the bean definition for the factory.
|
||||
*
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public class PluginRegistriesBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {
|
||||
@@ -90,7 +90,7 @@ public class PluginRegistriesBeanDefinitionRegistrar implements ImportBeanDefini
|
||||
|
||||
/**
|
||||
* Returns the target type of the {@link PluginRegistry} for the given plugin type.
|
||||
*
|
||||
*
|
||||
* @param pluginType must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.Assert;
|
||||
/**
|
||||
* Abstract base class to implement types that need access to all beans of a given type from the
|
||||
* {@link ApplicationContext}.
|
||||
*
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public abstract class AbstractTypeAwareSupport<T>
|
||||
@@ -59,7 +59,7 @@ public abstract class AbstractTypeAwareSupport<T>
|
||||
|
||||
/**
|
||||
* Configures the type of beans to be looked up.
|
||||
*
|
||||
*
|
||||
* @param type the type to set
|
||||
*/
|
||||
public void setType(Class<T> type) {
|
||||
@@ -68,7 +68,7 @@ public abstract class AbstractTypeAwareSupport<T>
|
||||
|
||||
/**
|
||||
* Configures the types to be excluded from the lookup.
|
||||
*
|
||||
*
|
||||
* @param exclusions
|
||||
*/
|
||||
public void setExclusions(Class<?>[] exclusions) {
|
||||
@@ -77,7 +77,7 @@ public abstract class AbstractTypeAwareSupport<T>
|
||||
|
||||
/**
|
||||
* Returns all beans from the {@link ApplicationContext} that match the given type.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -131,7 +131,7 @@ public abstract class AbstractTypeAwareSupport<T>
|
||||
* {@link ListableBeanFactory} the instance was set up with. Allows freezing the lookup as calls to
|
||||
* {@link ListableBeanFactory#getBeansOfType(Class, boolean, boolean)} are potentially expensive as the entire factory
|
||||
* has to be scanned for type information.
|
||||
*
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
static class BeansOfTypeTargetSource implements TargetSource {
|
||||
@@ -147,10 +147,11 @@ public abstract class AbstractTypeAwareSupport<T>
|
||||
/**
|
||||
* Creates a new {@link BeansOfTypeTargetSource} using the given {@link ListableBeanFactory} to lookup beans of the
|
||||
* given type.
|
||||
*
|
||||
*
|
||||
* @param context must not be {@literal null}.
|
||||
* @param type must not be {@literal null}.
|
||||
* @param eagerInit whether to eagerly init {@link FactoryBean}s, defaults to {@literal false}.
|
||||
* @param exclusions which types to exclude from the lookup, must not be {@literal null}.
|
||||
*/
|
||||
public BeansOfTypeTargetSource(ListableBeanFactory context, Class<?> type, boolean eagerInit,
|
||||
Collection<Class<?>> exclusions) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2008-2010 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
|
||||
@@ -27,7 +27,7 @@ import org.springframework.lang.NonNull;
|
||||
/**
|
||||
* Factory to create bean lists for a given type. Exposes all beans of the configured type that can be found in the
|
||||
* {@link org.springframework.context.ApplicationContext}.
|
||||
*
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public class BeanListFactoryBean<T> extends AbstractTypeAwareSupport<T> implements FactoryBean<List<T>> {
|
||||
|
||||
@@ -130,7 +130,6 @@ public class OrderAwarePluginRegistryUnitTest extends SimplePluginRegistryUnitTe
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
public boolean supports(String delimiter) {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -144,7 +143,6 @@ public class OrderAwarePluginRegistryUnitTest extends SimplePluginRegistryUnitTe
|
||||
* @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
|
||||
*/
|
||||
public boolean supports(String delimiter) {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user