Avoid defining nullability for non-relevant API
Defining nullability of some API like EnvironmentCapable or ConditionContext causes issues in Spring Boot because in the context where they are used, it is known for sure they will return non-null values even if their API can in other context return null values. It is better in this case for both Java and Kotlin to not define at all the nullabity of such API. In practice, this is achieved by removing the package level @NonNullApi annotation and adding it only on the relevant classes. Issue: SPR-15540
This commit is contained in:
parent
1f28825f9d
commit
b494c53b40
|
|
@ -21,6 +21,7 @@ import java.lang.annotation.Annotation;
|
|||
import org.springframework.core.GenericTypeResolver;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
|
@ -32,6 +33,7 @@ import org.springframework.lang.Nullable;
|
|||
* @since 3.1
|
||||
* @param <A> annotation containing {@linkplain #getAdviceModeAttributeName() AdviceMode attribute}
|
||||
*/
|
||||
@NonNullApi
|
||||
public abstract class AdviceModeImportSelector<A extends Annotation> implements ImportSelector {
|
||||
|
||||
public static final String DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME = "mode";
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import org.springframework.beans.factory.support.BeanNameGenerator;
|
|||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.env.EnvironmentCapable;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
|
@ -45,6 +46,7 @@ import org.springframework.util.Assert;
|
|||
* @since 3.0
|
||||
* @see AnnotationConfigApplicationContext#register
|
||||
*/
|
||||
@NonNullApi
|
||||
public class AnnotatedBeanDefinitionReader {
|
||||
|
||||
private final BeanDefinitionRegistry registry;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
|||
import org.springframework.beans.factory.support.BeanNameGenerator;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
|
@ -60,6 +61,7 @@ import org.springframework.util.StringUtils;
|
|||
* @see org.springframework.stereotype.Controller#value()
|
||||
* @see javax.inject.Named#value()
|
||||
*/
|
||||
@NonNullApi
|
||||
public class AnnotationBeanNameGenerator implements BeanNameGenerator {
|
||||
|
||||
private static final String COMPONENT_ANNOTATION_CLASSNAME = "org.springframework.stereotype.Component";
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import org.springframework.beans.factory.support.BeanNameGenerator;
|
|||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
|
@ -50,6 +51,7 @@ import org.springframework.util.Assert;
|
|||
* @see ClassPathBeanDefinitionScanner
|
||||
* @see org.springframework.context.support.GenericXmlApplicationContext
|
||||
*/
|
||||
@NonNullApi
|
||||
public class AnnotationConfigApplicationContext extends GenericApplicationContext implements AnnotationConfigRegistry {
|
||||
|
||||
private final AnnotatedBeanDefinitionReader reader;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.springframework.beans.factory.parsing.BeanComponentDefinition;
|
|||
import org.springframework.beans.factory.parsing.CompositeComponentDefinition;
|
||||
import org.springframework.beans.factory.xml.BeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Parser for the <context:annotation-config/> element.
|
||||
|
|
@ -36,6 +37,7 @@ import org.springframework.beans.factory.xml.ParserContext;
|
|||
* @since 2.5
|
||||
* @see AnnotationConfigUtils
|
||||
*/
|
||||
@NonNullApi
|
||||
public class AnnotationConfigBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Common interface for annotation config application contexts,
|
||||
* defining {@link #register} and {@link #scan} methods.
|
||||
|
|
@ -23,6 +25,7 @@ package org.springframework.context.annotation;
|
|||
* @author Juergen Hoeller
|
||||
* @since 4.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface AnnotationConfigRegistry {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import org.springframework.core.annotation.AnnotationAttributes;
|
|||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
import org.springframework.core.type.AnnotatedTypeMetadata;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
|
|
@ -60,6 +61,7 @@ import org.springframework.util.ClassUtils;
|
|||
* @see org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
|
||||
* @see org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
|
||||
*/
|
||||
@NonNullApi
|
||||
public class AnnotationConfigUtils {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import java.lang.annotation.Annotation;
|
|||
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
|
@ -36,6 +37,7 @@ import org.springframework.util.Assert;
|
|||
* @since 2.5
|
||||
* @see org.springframework.context.annotation.Scope
|
||||
*/
|
||||
@NonNullApi
|
||||
public class AnnotationScopeMetadataResolver implements ScopeMetadataResolver {
|
||||
|
||||
private final ScopedProxyMode defaultProxyMode;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import org.springframework.aop.config.AopConfigUtils;
|
|||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Registers an {@link org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
|
||||
|
|
@ -31,6 +32,7 @@ import org.springframework.core.type.AnnotationMetadata;
|
|||
* @since 3.1
|
||||
* @see EnableAspectJAutoProxy
|
||||
*/
|
||||
@NonNullApi
|
||||
class AspectJAutoProxyRegistrar implements ImportBeanDefinitionRegistrar {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.springframework.aop.config.AopConfigUtils;
|
|||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Registers an auto proxy creator against the current {@link BeanDefinitionRegistry}
|
||||
|
|
@ -35,6 +36,7 @@ import org.springframework.core.type.AnnotationMetadata;
|
|||
* @since 3.1
|
||||
* @see EnableAspectJAutoProxy
|
||||
*/
|
||||
@NonNullApi
|
||||
public class AutoProxyRegistrar implements ImportBeanDefinitionRegistrar {
|
||||
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.springframework.context.annotation;
|
|||
import java.lang.reflect.Method;
|
||||
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Utilities for processing {@link Bean}-annotated methods.
|
||||
|
|
@ -27,6 +28,7 @@ import org.springframework.core.annotation.AnnotatedElementUtils;
|
|||
* @author Juergen Hoeller
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
class BeanAnnotationHelper {
|
||||
|
||||
public static boolean isBeanAnnotated(Method method) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.springframework.context.annotation;
|
|||
import org.springframework.beans.factory.parsing.Problem;
|
||||
import org.springframework.beans.factory.parsing.ProblemReporter;
|
||||
import org.springframework.core.type.MethodMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Represents a {@link Configuration} class method marked with the
|
||||
|
|
@ -31,6 +32,7 @@ import org.springframework.core.type.MethodMetadata;
|
|||
* @see ConfigurationClassParser
|
||||
* @see ConfigurationClassBeanDefinitionReader
|
||||
*/
|
||||
@NonNullApi
|
||||
final class BeanMethod extends ConfigurationMethod {
|
||||
|
||||
public BeanMethod(MethodMetadata metadata, ConfigurationClass configurationClass) {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import org.springframework.core.env.Environment;
|
|||
import org.springframework.core.env.EnvironmentCapable;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.PatternMatchUtils;
|
||||
|
||||
|
|
@ -59,6 +60,7 @@ import org.springframework.util.PatternMatchUtils;
|
|||
* @see org.springframework.stereotype.Service
|
||||
* @see org.springframework.stereotype.Controller
|
||||
*/
|
||||
@NonNullApi
|
||||
public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateComponentProvider {
|
||||
|
||||
private final BeanDefinitionRegistry registry;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ import org.springframework.core.type.classreading.MetadataReaderFactory;
|
|||
import org.springframework.core.type.filter.AnnotationTypeFilter;
|
||||
import org.springframework.core.type.filter.AssignableTypeFilter;
|
||||
import org.springframework.core.type.filter.TypeFilter;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -84,6 +85,7 @@ import org.springframework.util.ClassUtils;
|
|||
* @see ScannedGenericBeanDefinition
|
||||
* @see CandidateComponentsIndex
|
||||
*/
|
||||
@NonNullApi
|
||||
public class ClassPathScanningCandidateComponentProvider implements EnvironmentCapable, ResourceLoaderAware {
|
||||
|
||||
static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ import org.springframework.core.BridgeMethodResolver;
|
|||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.jndi.support.SimpleJndiBeanFactory;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
|
@ -139,6 +140,7 @@ import org.springframework.util.StringValueResolver;
|
|||
* @see org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@NonNullApi
|
||||
public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBeanPostProcessor
|
||||
implements InstantiationAwareBeanPostProcessor, BeanFactoryAware, Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import org.springframework.core.type.filter.AspectJTypeFilter;
|
|||
import org.springframework.core.type.filter.AssignableTypeFilter;
|
||||
import org.springframework.core.type.filter.RegexPatternTypeFilter;
|
||||
import org.springframework.core.type.filter.TypeFilter;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
|
@ -52,6 +53,7 @@ import org.springframework.util.StringUtils;
|
|||
* @see ClassPathBeanDefinitionScanner#scan(String...)
|
||||
* @see ComponentScanBeanDefinitionParser
|
||||
*/
|
||||
@NonNullApi
|
||||
class ComponentScanAnnotationParser {
|
||||
|
||||
private final Environment environment;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import org.springframework.core.type.filter.AspectJTypeFilter;
|
|||
import org.springframework.core.type.filter.AssignableTypeFilter;
|
||||
import org.springframework.core.type.filter.RegexPatternTypeFilter;
|
||||
import org.springframework.core.type.filter.TypeFilter;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
|
@ -51,6 +52,7 @@ import org.springframework.util.StringUtils;
|
|||
* @author Juergen Hoeller
|
||||
* @since 2.5
|
||||
*/
|
||||
@NonNullApi
|
||||
public class ComponentScanBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
private static final String BASE_PACKAGE_ATTRIBUTE = "base-package";
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package org.springframework.context.annotation;
|
|||
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.core.type.AnnotatedTypeMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* A single {@code condition} that must be {@linkplain #matches matched} in order
|
||||
|
|
@ -39,6 +40,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
|
|||
* @see ConditionContext
|
||||
*/
|
||||
@FunctionalInterface
|
||||
@NonNullApi
|
||||
public interface Condition {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
|||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Context information for use by {@link Condition}s.
|
||||
|
|
@ -35,7 +34,6 @@ public interface ConditionContext {
|
|||
* should the condition match or {@code null} if the registry is not available.
|
||||
* @return the registry or {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
BeanDefinitionRegistry getRegistry();
|
||||
|
||||
/**
|
||||
|
|
@ -44,7 +42,6 @@ public interface ConditionContext {
|
|||
* is not available.
|
||||
* @return the bean factory or {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
ConfigurableListableBeanFactory getBeanFactory();
|
||||
|
||||
/**
|
||||
|
|
@ -52,7 +49,6 @@ public interface ConditionContext {
|
|||
* or {@code null} if no environment is available.
|
||||
* @return the environment or {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
Environment getEnvironment();
|
||||
|
||||
/**
|
||||
|
|
@ -60,7 +56,6 @@ public interface ConditionContext {
|
|||
* if the resource loader cannot be obtained.
|
||||
* @return a resource loader or {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
ResourceLoader getResourceLoader();
|
||||
|
||||
/**
|
||||
|
|
@ -68,7 +63,6 @@ public interface ConditionContext {
|
|||
* classes or {@code null} if the default classloader should be used.
|
||||
* @return the class loader or {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
ClassLoader getClassLoader();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import org.springframework.core.env.EnvironmentCapable;
|
|||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.type.AnnotatedTypeMetadata;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
|
@ -41,6 +42,7 @@ import org.springframework.util.MultiValueMap;
|
|||
* @author Phillip Webb
|
||||
* @since 4.0
|
||||
*/
|
||||
@NonNullApi
|
||||
class ConditionEvaluator {
|
||||
|
||||
private final ConditionContextImpl context;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import org.springframework.core.io.Resource;
|
|||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.core.type.StandardAnnotationMetadata;
|
||||
import org.springframework.core.type.classreading.MetadataReader;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
|
@ -47,6 +48,7 @@ import org.springframework.util.ClassUtils;
|
|||
* @see BeanMethod
|
||||
* @see ConfigurationClassParser
|
||||
*/
|
||||
@NonNullApi
|
||||
final class ConfigurationClass {
|
||||
|
||||
private final AnnotationMetadata metadata;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ import org.springframework.core.io.Resource;
|
|||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.core.type.MethodMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -67,6 +68,7 @@ import org.springframework.util.StringUtils;
|
|||
* @since 3.0
|
||||
* @see ConfigurationClassParser
|
||||
*/
|
||||
@NonNullApi
|
||||
class ConfigurationClassBeanDefinitionReader {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(ConfigurationClassBeanDefinitionReader.class);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ import org.springframework.cglib.proxy.NoOp;
|
|||
import org.springframework.cglib.transform.ClassEmitterTransformer;
|
||||
import org.springframework.cglib.transform.TransformingClassGenerator;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.objenesis.ObjenesisException;
|
||||
import org.springframework.objenesis.SpringObjenesis;
|
||||
|
|
@ -72,6 +73,7 @@ import org.springframework.util.ReflectionUtils;
|
|||
* @see #enhance
|
||||
* @see ConfigurationClassPostProcessor
|
||||
*/
|
||||
@NonNullApi
|
||||
class ConfigurationClassEnhancer {
|
||||
|
||||
// The callbacks to use. Note that these callbacks must be stateless.
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ import org.springframework.core.type.StandardAnnotationMetadata;
|
|||
import org.springframework.core.type.classreading.MetadataReader;
|
||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||
import org.springframework.core.type.filter.AssignableTypeFilter;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
|
@ -100,6 +101,7 @@ import org.springframework.util.StringUtils;
|
|||
* @since 3.0
|
||||
* @see ConfigurationClassBeanDefinitionReader
|
||||
*/
|
||||
@NonNullApi
|
||||
class ConfigurationClassParser {
|
||||
|
||||
private static final PropertySourceFactory DEFAULT_PROPERTY_SOURCE_FACTORY = new DefaultPropertySourceFactory();
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ import org.springframework.core.io.ResourceLoader;
|
|||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
|
||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
|
@ -85,6 +86,7 @@ import static org.springframework.context.annotation.AnnotationConfigUtils.*;
|
|||
* @author Phillip Webb
|
||||
* @since 3.0
|
||||
*/
|
||||
@NonNullApi
|
||||
public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPostProcessor,
|
||||
PriorityOrdered, ResourceLoaderAware, BeanClassLoaderAware, EnvironmentAware {
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import org.springframework.core.type.AnnotationMetadata;
|
|||
import org.springframework.core.type.StandardAnnotationMetadata;
|
||||
import org.springframework.core.type.classreading.MetadataReader;
|
||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
|
|
@ -44,6 +45,7 @@ import org.springframework.stereotype.Component;
|
|||
* @author Juergen Hoeller
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
abstract class ConfigurationClassUtils {
|
||||
|
||||
private static final String CONFIGURATION_CLASS_FULL = "full";
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* A {@link Condition} that offers more fine-grained control when used with
|
||||
* {@code @Configuration}. Allows certain {@link Condition}s to adapt when they match
|
||||
|
|
@ -27,6 +29,7 @@ package org.springframework.context.annotation;
|
|||
* @since 4.0
|
||||
* @see Configuration
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface ConfigurationCondition extends Condition {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,11 +19,13 @@ package org.springframework.context.annotation;
|
|||
import org.springframework.beans.factory.parsing.Location;
|
||||
import org.springframework.beans.factory.parsing.ProblemReporter;
|
||||
import org.springframework.core.type.MethodMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
abstract class ConfigurationMethod {
|
||||
|
||||
protected final MethodMetadata metadata;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Marker subclass of {@link IllegalStateException}, allowing for explicit
|
||||
* catch clauses in calling code.
|
||||
|
|
@ -24,6 +26,7 @@ package org.springframework.context.annotation;
|
|||
* @since 3.1
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@NonNullApi
|
||||
class ConflictingBeanDefinitionException extends IllegalStateException {
|
||||
|
||||
public ConflictingBeanDefinitionException(String message) {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import org.springframework.beans.factory.config.DependencyDescriptor;
|
|||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
|
@ -38,6 +39,7 @@ import org.springframework.util.Assert;
|
|||
* @author Juergen Hoeller
|
||||
* @since 4.0
|
||||
*/
|
||||
@NonNullApi
|
||||
public class ContextAnnotationAutowireCandidateResolver extends QualifierAnnotationAutowireCandidateResolver {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* A variation of {@link ImportSelector} that runs after all {@code @Configuration} beans
|
||||
* have been processed. This type of selector can be particularly useful when the selected
|
||||
|
|
@ -28,6 +30,7 @@ package org.springframework.context.annotation;
|
|||
* @author Phillip Webb
|
||||
* @since 4.0
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface DeferredImportSelector extends ImportSelector {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package org.springframework.context.annotation;
|
|||
|
||||
import org.springframework.beans.factory.Aware;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by any @{@link Configuration} class that wishes
|
||||
|
|
@ -28,6 +29,7 @@ import org.springframework.core.type.AnnotationMetadata;
|
|||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface ImportAware extends Aware {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.springframework.context.annotation;
|
|||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by types that register additional bean definitions when
|
||||
|
|
@ -47,6 +48,7 @@ import org.springframework.core.type.AnnotationMetadata;
|
|||
* @see ImportSelector
|
||||
* @see Configuration
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface ImportBeanDefinitionRegistrar {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -17,11 +17,13 @@
|
|||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
* @author Phil Webb
|
||||
*/
|
||||
@NonNullApi
|
||||
interface ImportRegistry {
|
||||
|
||||
AnnotationMetadata getImportingClassFor(String importedClass);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by types that determine which @{@link Configuration}
|
||||
|
|
@ -45,6 +46,7 @@ import org.springframework.core.type.AnnotationMetadata;
|
|||
* @see ImportBeanDefinitionRegistrar
|
||||
* @see Configuration
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface ImportSelector {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import java.util.Set;
|
|||
|
||||
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Simple {@link ScopeMetadataResolver} implementation that follows JSR-330 scoping rules:
|
||||
|
|
@ -39,6 +40,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
|
|||
* @see ClassPathBeanDefinitionScanner#setScopeMetadataResolver
|
||||
* @see AnnotatedBeanDefinitionReader#setScopeMetadataResolver
|
||||
*/
|
||||
@NonNullApi
|
||||
public class Jsr330ScopeMetadataResolver implements ScopeMetadataResolver {
|
||||
|
||||
private final Map<String, String> scopeMap = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.springframework.context.weaving.DefaultContextLoadTimeWeaver;
|
|||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.instrument.classloading.LoadTimeWeaver;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +42,7 @@ import org.springframework.lang.Nullable;
|
|||
* @see ConfigurableApplicationContext#LOAD_TIME_WEAVER_BEAN_NAME
|
||||
*/
|
||||
@Configuration
|
||||
@NonNullApi
|
||||
public class LoadTimeWeavingConfiguration implements ImportAware, BeanClassLoaderAware {
|
||||
|
||||
private AnnotationAttributes enableLTW;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.instrument.classloading.LoadTimeWeaver;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by
|
||||
|
|
@ -33,6 +34,7 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
|
|||
* @see LoadTimeWeavingConfiguration
|
||||
* @see EnableLoadTimeWeaving
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface LoadTimeWeavingConfigurer {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import org.springframework.jmx.export.annotation.AnnotationMBeanExporter;
|
|||
import org.springframework.jmx.support.RegistrationPolicy;
|
||||
import org.springframework.jmx.support.WebSphereMBeanServerFactoryBean;
|
||||
import org.springframework.jndi.JndiLocatorDelegate;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
|
@ -48,6 +49,7 @@ import org.springframework.util.StringUtils;
|
|||
* @see EnableMBeanExport
|
||||
*/
|
||||
@Configuration
|
||||
@NonNullApi
|
||||
public class MBeanExportConfiguration implements ImportAware, EnvironmentAware, BeanFactoryAware {
|
||||
|
||||
private static final String MBEAN_EXPORTER_BEAN_NAME = "mbeanExporter";
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.springframework.context.EnvironmentAware;
|
|||
import org.springframework.context.ResourceLoaderAware;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Common delegate code for the handling of parser strategies, e.g.
|
||||
|
|
@ -34,6 +35,7 @@ import org.springframework.core.io.ResourceLoader;
|
|||
* @author Juergen Hoeller
|
||||
* @since 4.3.3
|
||||
*/
|
||||
@NonNullApi
|
||||
abstract class ParserStrategyUtils {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.springframework.beans.factory.support.GenericBeanDefinition;
|
|||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.core.type.MethodMetadata;
|
||||
import org.springframework.core.type.classreading.MetadataReader;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
|
@ -45,6 +46,7 @@ import org.springframework.util.Assert;
|
|||
* @see AnnotatedGenericBeanDefinition
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@NonNullApi
|
||||
public class ScannedGenericBeanDefinition extends GenericBeanDefinition implements AnnotatedBeanDefinition {
|
||||
|
||||
private final AnnotationMetadata metadata;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
|
@ -32,6 +33,7 @@ import org.springframework.util.Assert;
|
|||
* @see ScopeMetadataResolver
|
||||
* @see ScopedProxyMode
|
||||
*/
|
||||
@NonNullApi
|
||||
public class ScopeMetadata {
|
||||
|
||||
private String scopeName = BeanDefinition.SCOPE_SINGLETON;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Strategy interface for resolving the scope of bean definitions.
|
||||
|
|
@ -26,6 +27,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
|
|||
* @see org.springframework.context.annotation.Scope
|
||||
*/
|
||||
@FunctionalInterface
|
||||
@NonNullApi
|
||||
public interface ScopeMetadataResolver {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.springframework.context.annotation;
|
|||
import org.springframework.aop.scope.ScopedProxyUtils;
|
||||
import org.springframework.beans.factory.config.BeanDefinitionHolder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Delegate factory class used to just introduce an AOP framework dependency
|
||||
|
|
@ -28,6 +29,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
|||
* @since 3.0
|
||||
* @see org.springframework.aop.scope.ScopedProxyUtils#createScopedProxy
|
||||
*/
|
||||
@NonNullApi
|
||||
class ScopedProxyCreator {
|
||||
|
||||
public static BeanDefinitionHolder createScopedProxy(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,4 @@
|
|||
* annotations, component-scanning, and Java-based metadata for creating
|
||||
* Spring-managed objects.
|
||||
*/
|
||||
@NonNullApi
|
||||
package org.springframework.context.annotation;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
|
@ -27,6 +27,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
|
||||
import org.springframework.core.SpringProperties;
|
||||
import org.springframework.core.convert.support.ConfigurableConversionService;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
|
@ -51,6 +52,7 @@ import org.springframework.util.StringUtils;
|
|||
* @see ConfigurableEnvironment
|
||||
* @see StandardEnvironment
|
||||
*/
|
||||
@NonNullApi
|
||||
public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.support.ConfigurableConversionService;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
|
@ -38,6 +39,7 @@ import org.springframework.util.SystemPropertyUtils;
|
|||
* @author Juergen Hoeller
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public abstract class AbstractPropertyResolver implements ConfigurablePropertyResolver {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
|
@ -33,6 +34,7 @@ import org.springframework.lang.Nullable;
|
|||
* @since 3.1
|
||||
* @see SimpleCommandLineArgsParser
|
||||
*/
|
||||
@NonNullApi
|
||||
class CommandLineArgs {
|
||||
|
||||
private final Map<String, List<String>> optionArgs = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.springframework.core.env;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
|
@ -204,6 +205,7 @@ import org.springframework.util.StringUtils;
|
|||
* @see SimpleCommandLinePropertySource
|
||||
* @see JOptCommandLinePropertySource
|
||||
*/
|
||||
@NonNullApi
|
||||
public abstract class CommandLinePropertySource<T> extends EnumerablePropertySource<T> {
|
||||
|
||||
/** The default name given to {@link CommandLinePropertySource} instances: {@value} */
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.LinkedHashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -39,6 +40,7 @@ import org.springframework.util.StringUtils;
|
|||
* @author Phillip Webb
|
||||
* @since 3.1.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public class CompositePropertySource extends EnumerablePropertySource<Object> {
|
||||
|
||||
private final Set<PropertySource<?>> propertySources = new LinkedHashSet<>();
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ package org.springframework.core.env;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Configuration interface to be implemented by most if not all {@link Environment} types.
|
||||
* Provides facilities for setting active and default profiles and manipulating underlying
|
||||
|
|
@ -69,6 +71,7 @@ import java.util.Map;
|
|||
* @see StandardEnvironment
|
||||
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface ConfigurableEnvironment extends Environment, ConfigurablePropertyResolver {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.core.convert.support.ConfigurableConversionService;
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
|
@ -28,6 +29,7 @@ import org.springframework.lang.Nullable;
|
|||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface ConfigurablePropertyResolver extends PropertyResolver {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +42,7 @@ import org.springframework.util.ObjectUtils;
|
|||
* @author Juergen Hoeller
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public abstract class EnumerablePropertySource<T> extends PropertySource<T> {
|
||||
|
||||
public EnumerablePropertySource(String name, T source) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Interface representing the environment in which the current application is running.
|
||||
* Models two key aspects of the application environment: <em>profiles</em> and
|
||||
|
|
@ -68,6 +70,7 @@ package org.springframework.core.env;
|
|||
* @see org.springframework.context.ConfigurableApplicationContext#setEnvironment
|
||||
* @see org.springframework.context.support.AbstractApplicationContext#createEnvironment
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface Environment extends PropertyResolver {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Interface indicating a component that contains and exposes an {@link Environment} reference.
|
||||
*
|
||||
|
|
@ -46,7 +44,6 @@ public interface EnvironmentCapable {
|
|||
* Return the {@link Environment} associated with this component
|
||||
* (may be {@code null} or a default environment).
|
||||
*/
|
||||
@Nullable
|
||||
Environment getEnvironment();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ import java.util.List;
|
|||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpec;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* {@link CommandLinePropertySource} implementation backed by a JOpt {@link OptionSet}.
|
||||
*
|
||||
|
|
@ -54,6 +56,7 @@ import joptsimple.OptionSpec;
|
|||
* @see joptsimple.OptionParser
|
||||
* @see joptsimple.OptionSet
|
||||
*/
|
||||
@NonNullApi
|
||||
public class JOptCommandLinePropertySource extends CommandLinePropertySource<OptionSet> {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package org.springframework.core.env;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -28,6 +29,7 @@ import org.springframework.util.StringUtils;
|
|||
* @since 3.1
|
||||
* @see PropertiesPropertySource
|
||||
*/
|
||||
@NonNullApi
|
||||
public class MapPropertySource extends EnumerablePropertySource<Map<String, Object>> {
|
||||
|
||||
public MapPropertySource(String name, Map<String, Object> source) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ package org.springframework.core.env;
|
|||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Exception thrown when required properties are not found.
|
||||
*
|
||||
|
|
@ -29,6 +31,7 @@ import java.util.Set;
|
|||
* @see org.springframework.context.support.AbstractApplicationContext#prepareRefresh()
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@NonNullApi
|
||||
public class MissingRequiredPropertiesException extends IllegalStateException {
|
||||
|
||||
private final Set<String> missingRequiredProperties = new LinkedHashSet<>();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
|
@ -40,6 +41,7 @@ import org.springframework.util.StringUtils;
|
|||
* @since 3.1
|
||||
* @see PropertySourcesPropertyResolver
|
||||
*/
|
||||
@NonNullApi
|
||||
public class MutablePropertySources implements PropertySources {
|
||||
|
||||
private final Log logger;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ package org.springframework.core.env;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* {@link PropertySource} implementation that extracts properties from a
|
||||
* {@link java.util.Properties} object.
|
||||
|
|
@ -33,6 +35,7 @@ import java.util.Properties;
|
|||
* @author Juergen Hoeller
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public class PropertiesPropertySource extends MapPropertySource {
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
|
@ -27,6 +28,7 @@ import org.springframework.lang.Nullable;
|
|||
* @see Environment
|
||||
* @see PropertySourcesPropertyResolver
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface PropertyResolver {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.springframework.core.env;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
|
@ -56,6 +57,7 @@ import org.springframework.util.ObjectUtils;
|
|||
* @see MutablePropertySources
|
||||
* @see org.springframework.context.annotation.PropertySource
|
||||
*/
|
||||
@NonNullApi
|
||||
public abstract class PropertySource<T> {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
|
@ -24,6 +25,7 @@ import org.springframework.lang.Nullable;
|
|||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
public interface PropertySources extends Iterable<PropertySource<?>> {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
|
|
@ -29,6 +30,7 @@ import org.springframework.lang.Nullable;
|
|||
* @see PropertySources
|
||||
* @see AbstractEnvironment
|
||||
*/
|
||||
@NonNullApi
|
||||
public class PropertySourcesPropertyResolver extends AbstractPropertyResolver {
|
||||
|
||||
private final PropertySources propertySources;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ import java.util.Collections;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Read-only {@code Map<String, String>} implementation that is backed by system
|
||||
* properties or environment variables.
|
||||
|
|
@ -35,6 +37,7 @@ import java.util.Set;
|
|||
* @author Chris Beams
|
||||
* @since 3.0
|
||||
*/
|
||||
@NonNullApi
|
||||
abstract class ReadOnlySystemAttributesMap implements Map<String, String> {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* Parses a {@code String[]} of command line arguments in order to populate a
|
||||
* {@link CommandLineArgs} object.
|
||||
|
|
@ -49,6 +51,7 @@ package org.springframework.core.env;
|
|||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
*/
|
||||
@NonNullApi
|
||||
class SimpleCommandLineArgsParser {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ package org.springframework.core.env;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* {@link CommandLinePropertySource} implementation backed by a simple String array.
|
||||
*
|
||||
|
|
@ -75,6 +77,7 @@ import java.util.List;
|
|||
* @see CommandLinePropertySource
|
||||
* @see JOptCommandLinePropertySource
|
||||
*/
|
||||
@NonNullApi
|
||||
public class SimpleCommandLinePropertySource extends CommandLinePropertySource<CommandLineArgs> {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
||||
/**
|
||||
* {@link Environment} implementation suitable for use in 'standard' (i.e. non-web)
|
||||
* applications.
|
||||
|
|
@ -51,6 +53,7 @@ package org.springframework.core.env;
|
|||
* @see SystemEnvironmentPropertySource
|
||||
* @see org.springframework.web.context.support.StandardServletEnvironment
|
||||
*/
|
||||
@NonNullApi
|
||||
public class StandardEnvironment extends AbstractEnvironment {
|
||||
|
||||
/** System environment property source name: {@value} */
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package org.springframework.core.env;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
|
@ -63,6 +64,7 @@ import org.springframework.util.Assert;
|
|||
* @see AbstractEnvironment#getSystemEnvironment()
|
||||
* @see AbstractEnvironment#ACTIVE_PROFILES_PROPERTY_NAME
|
||||
*/
|
||||
@NonNullApi
|
||||
public class SystemEnvironmentPropertySource extends MapPropertySource {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,7 +2,4 @@
|
|||
* Spring's environment abstraction consisting of bean definition
|
||||
* profile and hierarchical property source support.
|
||||
*/
|
||||
@NonNullApi
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import javax.annotation.meta.TypeQualifierDefault;
|
|||
*/
|
||||
@Documented
|
||||
@Nonnull
|
||||
@Target(ElementType.PACKAGE)
|
||||
@Target({ElementType.PACKAGE, ElementType.TYPE})
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface NonNullApi {
|
||||
|
|
|
|||
Loading…
Reference in New Issue