Fix javadoc checkstyle issues
Fix checkstyle violations for javadoc. Issue: SPR-16968
This commit is contained in:
committed by
Juergen Hoeller
parent
032096d699
commit
e0480f75ac
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -24,10 +24,9 @@ import org.springframework.lang.Nullable;
|
||||
* Advice invoked before a method is invoked. Such advices cannot
|
||||
* prevent the method call proceeding, unless they throw a Throwable.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @see AfterReturningAdvice
|
||||
* @see ThrowsAdvice
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
public interface MethodBeforeAdvice extends BeforeAdvice {
|
||||
|
||||
|
||||
@@ -117,16 +117,16 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
||||
|
||||
/**
|
||||
* This will be non-null if the creator of this advice object knows the argument names
|
||||
* and sets them explicitly
|
||||
* and sets them explicitly.
|
||||
*/
|
||||
@Nullable
|
||||
private String[] argumentNames;
|
||||
|
||||
/** Non-null if after throwing advice binds the thrown value */
|
||||
/** Non-null if after throwing advice binds the thrown value. */
|
||||
@Nullable
|
||||
private String throwingName;
|
||||
|
||||
/** Non-null if after returning advice binds the return value */
|
||||
/** Non-null if after returning advice binds the return value. */
|
||||
@Nullable
|
||||
private String returningName;
|
||||
|
||||
@@ -136,13 +136,13 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
||||
|
||||
/**
|
||||
* Index for thisJoinPoint argument (currently only
|
||||
* supported at index 0 if present at all)
|
||||
* supported at index 0 if present at all).
|
||||
*/
|
||||
private int joinPointArgumentIndex = -1;
|
||||
|
||||
/**
|
||||
* Index for thisJoinPointStaticPart argument (currently only
|
||||
* supported at index 0 if present at all)
|
||||
* supported at index 0 if present at all).
|
||||
*/
|
||||
private int joinPointStaticPartArgumentIndex = -1;
|
||||
|
||||
@@ -551,7 +551,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
||||
|
||||
/**
|
||||
* Take the arguments at the method execution join point and output a set of arguments
|
||||
* to the advice method
|
||||
* to the advice method.
|
||||
* @param jp the current JoinPoint
|
||||
* @param jpMatch the join point match that matched this execution join point
|
||||
* @param returnValue the return value from the method execution (may be null)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -156,17 +156,17 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
||||
}
|
||||
|
||||
|
||||
/** The pointcut expression associated with the advice, as a simple String */
|
||||
/** The pointcut expression associated with the advice, as a simple String. */
|
||||
@Nullable
|
||||
private String pointcutExpression;
|
||||
|
||||
private boolean raiseExceptions;
|
||||
|
||||
/** If the advice is afterReturning, and binds the return value, this is the parameter name used */
|
||||
/** If the advice is afterReturning, and binds the return value, this is the parameter name used. */
|
||||
@Nullable
|
||||
private String returningName;
|
||||
|
||||
/** If the advice is afterThrowing, and binds the thrown value, this is the parameter name used */
|
||||
/** If the advice is afterThrowing, and binds the thrown value, this is the parameter name used. */
|
||||
@Nullable
|
||||
private String throwingName;
|
||||
|
||||
@@ -178,7 +178,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
||||
|
||||
|
||||
/**
|
||||
* Create a new discoverer that attempts to discover parameter names
|
||||
* Create a new discoverer that attempts to discover parameter names.
|
||||
* from the given pointcut expression.
|
||||
*/
|
||||
public AspectJAdviceParameterNameDiscoverer(@Nullable String pointcutExpression) {
|
||||
@@ -677,7 +677,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
||||
}
|
||||
|
||||
/**
|
||||
* Match up args against unbound arguments of primitive types
|
||||
* Match up args against unbound arguments of primitive types.
|
||||
*/
|
||||
private void maybeBindPrimitiveArgsFromPointcutExpression() {
|
||||
int numUnboundPrimitives = countNumberOfUnboundPrimitiveArguments();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -43,7 +43,7 @@ public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered {
|
||||
|
||||
|
||||
/**
|
||||
* Create a new AspectJPointcutAdvisor for the given advice
|
||||
* Create a new AspectJPointcutAdvisor for the given advice.
|
||||
* @param advice the AbstractAspectJAdvice to wrap
|
||||
*/
|
||||
public AspectJPointcutAdvisor(AbstractAspectJAdvice advice) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -36,8 +36,8 @@ public abstract class AspectJProxyUtils {
|
||||
* This will expose the current Spring AOP invocation (necessary for some AspectJ pointcut matching)
|
||||
* and make available the current AspectJ JoinPoint. The call will have no effect if there are no
|
||||
* AspectJ advisors in the advisor chain.
|
||||
* @param advisors Advisors available
|
||||
* @return {@code true} if any special {@link Advisor Advisors} were added, otherwise {@code false}.
|
||||
* @param advisors the advisors available
|
||||
* @return {@code true} if any special {@link Advisor Advisors} were added, otherwise {@code false}
|
||||
*/
|
||||
public static boolean makeAdvisorChainAspectJCapableIfNecessary(List<Advisor> advisors) {
|
||||
// Don't add advisors to an empty list; may indicate that proxying is just not required
|
||||
|
||||
@@ -65,7 +65,7 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
|
||||
|
||||
/**
|
||||
* Private constructor to share common code between impl-based delegate and reference-based delegate
|
||||
* (cannot use method such as init() to share common code, due the use of final fields)
|
||||
* (cannot use method such as init() to share common code, due the use of final fields).
|
||||
* @param interfaceType static field defining the introduction
|
||||
* @param typePattern type pattern the introduction is restricted to
|
||||
* @param interceptor the delegation advice as {@link IntroductionInterceptor}
|
||||
|
||||
@@ -58,11 +58,11 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
|
||||
@Nullable
|
||||
private Object[] args;
|
||||
|
||||
/** Lazily initialized signature object */
|
||||
/** Lazily initialized signature object. */
|
||||
@Nullable
|
||||
private Signature signature;
|
||||
|
||||
/** Lazily initialized source location object */
|
||||
/** Lazily initialized source location object. */
|
||||
@Nullable
|
||||
private SourceLocation sourceLocation;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -51,7 +51,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* migrate to {@code ShadowMatch.getVariablesInvolvedInRuntimeTest()}
|
||||
* or some similar operation.
|
||||
*
|
||||
* <p>See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=151593"/>Bug 151593</a>
|
||||
* <p>See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=151593">Bug 151593</a>
|
||||
*
|
||||
* @author Adrian Colyer
|
||||
* @author Ramnivas Laddad
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -61,7 +61,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
||||
private static final String AJC_MAGIC = "ajc$";
|
||||
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
protected final ParameterNameDiscoverer parameterNameDiscoverer = new AspectJAnnotationParameterNameDiscoverer();
|
||||
@@ -123,7 +123,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
||||
|
||||
/**
|
||||
* Find and return the first AspectJ annotation on the given method
|
||||
* (there <i>should</i> only be one anyway...)
|
||||
* (there <i>should</i> only be one anyway...).
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
@@ -151,6 +151,9 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* AspectJ annotation types.
|
||||
*/
|
||||
protected enum AspectJAnnotationType {
|
||||
|
||||
AtPointcut,
|
||||
@@ -165,6 +168,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
|
||||
/**
|
||||
* Class modelling an AspectJ annotation, exposing its type enumeration and
|
||||
* pointcut String.
|
||||
* @param <A> the annotation type
|
||||
*/
|
||||
protected static class AspectJAnnotation<A extends Annotation> {
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.springframework.util.ClassUtils;
|
||||
@SuppressWarnings("serial")
|
||||
public class AspectJProxyFactory extends ProxyCreatorSupport {
|
||||
|
||||
/** Cache for singleton aspect instances */
|
||||
/** Cache for singleton aspect instances. */
|
||||
private static final Map<Class<?>, Object> aspectCache = new ConcurrentHashMap<>();
|
||||
|
||||
private final AspectJAdvisorFactory aspectFactory = new ReflectiveAspectJAdvisorFactory();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -55,7 +55,7 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
|
||||
* Create a BeanFactoryAspectInstanceFactory. AspectJ will be called to
|
||||
* introspect to create AJType metadata using the type returned for the
|
||||
* given bean name from the BeanFactory.
|
||||
* @param beanFactory BeanFactory to obtain instance(s) from
|
||||
* @param beanFactory the BeanFactory to obtain instance(s) from
|
||||
* @param name name of the bean
|
||||
*/
|
||||
public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name) {
|
||||
@@ -66,7 +66,7 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
|
||||
* Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should
|
||||
* introspect to create AJType metadata. Use if the BeanFactory may consider the type
|
||||
* to be a subclass (as when using CGLIB), and the information should relate to a superclass.
|
||||
* @param beanFactory BeanFactory to obtain instance(s) from
|
||||
* @param beanFactory the BeanFactory to obtain instance(s) from
|
||||
* @param name the name of the bean
|
||||
* @param type the type that should be introspected by AspectJ
|
||||
* ({@code null} indicates resolution through {@link BeanFactory#getType} via the bean name)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -160,7 +160,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
|
||||
* Subclasses may choose to implement this: for example,
|
||||
* to change the interfaces exposed.
|
||||
* <p>The default implementation is empty.
|
||||
* @param proxyFactory ProxyFactory that is already configured with
|
||||
* @param proxyFactory the ProxyFactory that is already configured with
|
||||
* target, advisor and interfaces and will be used to create the proxy
|
||||
* immediately after this method returns
|
||||
* @since 4.2.3
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -54,7 +54,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
|
||||
@Nullable
|
||||
private Object[] postInterceptors;
|
||||
|
||||
/** Default is global AdvisorAdapterRegistry */
|
||||
/** Default is global AdvisorAdapterRegistry. */
|
||||
private AdvisorAdapterRegistry advisorAdapterRegistry = GlobalAdvisorAdapterRegistry.getInstance();
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -211,7 +211,7 @@ public interface Advised extends TargetClassAware {
|
||||
* or -1 if no such advice is an advice for this proxy.
|
||||
* <p>The return value of this method can be used to index into
|
||||
* the advisors array.
|
||||
* @param advice AOP Alliance advice to search for
|
||||
* @param advice the AOP Alliance advice to search for
|
||||
* @return index from 0 of this advice, or -1 if there's no such advice
|
||||
*/
|
||||
int indexOf(Advice advice);
|
||||
|
||||
@@ -61,7 +61,7 @@ import org.springframework.util.CollectionUtils;
|
||||
*/
|
||||
public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
|
||||
/** use serialVersionUID from Spring 2.0 for interoperability */
|
||||
/** use serialVersionUID from Spring 2.0 for interoperability. */
|
||||
private static final long serialVersionUID = 2651364800145442165L;
|
||||
|
||||
|
||||
@@ -72,16 +72,16 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
public static final TargetSource EMPTY_TARGET_SOURCE = EmptyTargetSource.INSTANCE;
|
||||
|
||||
|
||||
/** Package-protected to allow direct access for efficiency */
|
||||
/** Package-protected to allow direct access for efficiency. */
|
||||
TargetSource targetSource = EMPTY_TARGET_SOURCE;
|
||||
|
||||
/** Whether the Advisors are already filtered for the specific target class */
|
||||
/** Whether the Advisors are already filtered for the specific target class. */
|
||||
private boolean preFiltered = false;
|
||||
|
||||
/** The AdvisorChainFactory to use */
|
||||
/** The AdvisorChainFactory to use. */
|
||||
AdvisorChainFactory advisorChainFactory = new DefaultAdvisorChainFactory();
|
||||
|
||||
/** Cache with Method as key and advisor chain List as value */
|
||||
/** Cache with Method as key and advisor chain List as value. */
|
||||
private transient Map<MethodCacheKey, List<Object>> methodCache;
|
||||
|
||||
/**
|
||||
@@ -474,7 +474,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
* for the given method, based on this configuration.
|
||||
* @param method the proxied method
|
||||
* @param targetClass the target class
|
||||
* @return List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
|
||||
* @return a List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
|
||||
*/
|
||||
public List<Object> getInterceptorsAndDynamicInterceptionAdvice(Method method, @Nullable Class<?> targetClass) {
|
||||
MethodCacheKey cacheKey = new MethodCacheKey(method);
|
||||
@@ -528,7 +528,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
|
||||
|
||||
/**
|
||||
* Build a configuration-only copy of this AdvisedSupport,
|
||||
* replacing the TargetSource
|
||||
* replacing the TargetSource.
|
||||
*/
|
||||
AdvisedSupport getConfigurationOnlyCopy() {
|
||||
AdvisedSupport copy = new AdvisedSupport();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -36,7 +36,7 @@ public interface AdvisorChainFactory {
|
||||
* @param method the proxied method
|
||||
* @param targetClass the target class (may be {@code null} to indicate a proxy without
|
||||
* target object, in which case the method's declaring class is the next best option)
|
||||
* @return List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
|
||||
* @return a List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
|
||||
*/
|
||||
List<Object> getInterceptorsAndDynamicInterceptionAdvice(Advised config, Method method, @Nullable Class<?> targetClass);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -54,7 +54,7 @@ public abstract class AopContext {
|
||||
* Try to return the current AOP proxy. This method is usable only if the
|
||||
* calling method has been invoked via AOP, and the AOP framework has been set
|
||||
* to expose proxies. Otherwise, this method will throw an IllegalStateException.
|
||||
* @return Object the current AOP proxy (never returns {@code null})
|
||||
* @return the current AOP proxy (never returns {@code null})
|
||||
* @throws IllegalStateException if the proxy cannot be found, because the
|
||||
* method was invoked outside an AOP invocation context, or because the
|
||||
* AOP framework has not been configured to expose the proxy
|
||||
|
||||
@@ -93,14 +93,14 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
private static final int INVOKE_HASHCODE = 6;
|
||||
|
||||
|
||||
/** Logger available to subclasses; static to optimize serialization */
|
||||
/** Logger available to subclasses; static to optimize serialization. */
|
||||
protected static final Log logger = LogFactory.getLog(CglibAopProxy.class);
|
||||
|
||||
/** Keeps track of the Classes that we have validated for final methods */
|
||||
/** Keeps track of the Classes that we have validated for final methods. */
|
||||
private static final Map<Class<?>, Boolean> validatedClasses = new WeakHashMap<>();
|
||||
|
||||
|
||||
/** The configuration used to configure this proxy */
|
||||
/** The configuration used to configure this proxy. */
|
||||
protected final AdvisedSupport advised;
|
||||
|
||||
@Nullable
|
||||
@@ -109,7 +109,7 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
@Nullable
|
||||
protected Class<?>[] constructorArgTypes;
|
||||
|
||||
/** Dispatcher used for methods on Advised */
|
||||
/** Dispatcher used for methods on Advised. */
|
||||
private final transient AdvisedDispatcher advisedDispatcher;
|
||||
|
||||
private transient Map<String, Integer> fixedInterceptorMap = Collections.emptyMap();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -63,7 +63,7 @@ import org.springframework.util.ClassUtils;
|
||||
*/
|
||||
final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializable {
|
||||
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability */
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability. */
|
||||
private static final long serialVersionUID = 5531744639992436476L;
|
||||
|
||||
|
||||
@@ -76,10 +76,10 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
|
||||
* This way, we can also more easily take advantage of minor optimizations in each class.
|
||||
*/
|
||||
|
||||
/** We use a static Log to avoid serialization issues */
|
||||
/** We use a static Log to avoid serialization issues. */
|
||||
private static final Log logger = LogFactory.getLog(JdkDynamicAopProxy.class);
|
||||
|
||||
/** Config used to configure this proxy */
|
||||
/** Config used to configure this proxy. */
|
||||
private final AdvisedSupport advised;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class ProxyConfig implements Serializable {
|
||||
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability */
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability. */
|
||||
private static final long serialVersionUID = -8409359707199703185L;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -36,7 +36,7 @@ public class ProxyCreatorSupport extends AdvisedSupport {
|
||||
|
||||
private List<AdvisedSupportListener> listeners = new LinkedList<>();
|
||||
|
||||
/** Set to true when the first AOP proxy has been created */
|
||||
/** Set to true when the first AOP proxy has been created. */
|
||||
private boolean active = false;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -124,10 +124,10 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
|
||||
@Nullable
|
||||
private transient BeanFactory beanFactory;
|
||||
|
||||
/** Whether the advisor chain has already been initialized */
|
||||
/** Whether the advisor chain has already been initialized. */
|
||||
private boolean advisorChainInitialized = false;
|
||||
|
||||
/** If this is a singleton, the cached singleton proxy instance */
|
||||
/** If this is a singleton, the cached singleton proxy instance. */
|
||||
@Nullable
|
||||
private Object singletonInstance;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -50,7 +50,7 @@ public interface AdvisorAdapterRegistry {
|
||||
* given Advisor in an interception-based framework.
|
||||
* <p>Don't worry about the pointcut associated with the Advisor,
|
||||
* if it's a PointcutAdvisor: just return an interceptor.
|
||||
* @param advisor Advisor to find an interceptor for
|
||||
* @param advisor the Advisor to find an interceptor for
|
||||
* @return an array of MethodInterceptors to expose this Advisor's behavior
|
||||
* @throws UnknownAdviceTypeException if the Advisor type is
|
||||
* not understood by any registered AdvisorAdapter.
|
||||
@@ -61,7 +61,7 @@ public interface AdvisorAdapterRegistry {
|
||||
* Register the given AdvisorAdapter. Note that it is not necessary to register
|
||||
* adapters for an AOP Alliance Interceptors or Spring Advices: these must be
|
||||
* automatically recognized by an AdvisorAdapterRegistry implementation.
|
||||
* @param adapter AdvisorAdapter that understands a particular Advisor
|
||||
* @param adapter the AdvisorAdapter that understands a particular Advisor
|
||||
* or Advice types
|
||||
*/
|
||||
void registerAdvisorAdapter(AdvisorAdapter adapter);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -61,7 +61,7 @@ public class ThrowsAdviceInterceptor implements MethodInterceptor, AfterAdvice {
|
||||
|
||||
private final Object throwsAdvice;
|
||||
|
||||
/** Methods on throws advice, keyed by exception class */
|
||||
/** Methods on throws advice, keyed by exception class. */
|
||||
private final Map<Class<?>, Method> exceptionHandlerMap = new HashMap<>();
|
||||
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ public abstract class AbstractAdvisorAutoProxyCreator extends AbstractAutoProxyC
|
||||
* <p>The default implementation is empty.
|
||||
* <p>Typically used to add Advisors that expose contextual information
|
||||
* required by some of the later advisors.
|
||||
* @param candidateAdvisors Advisors that have already been identified as
|
||||
* @param candidateAdvisors the Advisors that have already been identified as
|
||||
* applying to a given bean
|
||||
*/
|
||||
protected void extendAdvisors(List<Advisor> candidateAdvisors) {
|
||||
|
||||
@@ -109,10 +109,10 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
protected static final Object[] PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS = new Object[0];
|
||||
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
/** Default is global AdvisorAdapterRegistry */
|
||||
/** Default is global AdvisorAdapterRegistry. */
|
||||
private AdvisorAdapterRegistry advisorAdapterRegistry = GlobalAdvisorAdapterRegistry.getInstance();
|
||||
|
||||
/**
|
||||
@@ -121,7 +121,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
*/
|
||||
private boolean freezeProxy = false;
|
||||
|
||||
/** Default is no common interceptors */
|
||||
/** Default is no common interceptors. */
|
||||
private String[] interceptorNames = new String[0];
|
||||
|
||||
private boolean applyCommonInterceptorsFirst = true;
|
||||
@@ -561,7 +561,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
* Subclasses may choose to implement this: for example,
|
||||
* to change the interfaces exposed.
|
||||
* <p>The default implementation is empty.
|
||||
* @param proxyFactory ProxyFactory that is already configured with
|
||||
* @param proxyFactory a ProxyFactory that is already configured with
|
||||
* TargetSource and interfaces and will be used to create the proxy
|
||||
* immediately after this method returns
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -38,7 +38,7 @@ import org.springframework.lang.Nullable;
|
||||
@SuppressWarnings("serial")
|
||||
public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator implements BeanNameAware {
|
||||
|
||||
/** Separator between prefix and remainder of bean name */
|
||||
/** Separator between prefix and remainder of bean name. */
|
||||
public static final String SEPARATOR = ".";
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -29,7 +29,7 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public class ProxyCreationContext {
|
||||
|
||||
/** ThreadLocal holding the current proxied bean name during Advisor matching */
|
||||
/** ThreadLocal holding the current proxied bean name during Advisor matching. */
|
||||
private static final ThreadLocal<String> currentProxiedBeanName =
|
||||
new NamedThreadLocal<>("Name of currently proxied bean");
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class AbstractBeanFactoryBasedTargetSourceCreator
|
||||
|
||||
private ConfigurableBeanFactory beanFactory;
|
||||
|
||||
/** Internally used DefaultListableBeanFactory instances, keyed by bean name */
|
||||
/** Internally used DefaultListableBeanFactory instances, keyed by bean name. */
|
||||
private final Map<String, DefaultListableBeanFactory> internalBeanFactories =
|
||||
new HashMap<>();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -37,8 +37,19 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public class QuickTargetSourceCreator extends AbstractBeanFactoryBasedTargetSourceCreator {
|
||||
|
||||
/**
|
||||
* The CommonsPool2TargetSource prefix.
|
||||
*/
|
||||
public static final String PREFIX_COMMONS_POOL = ":";
|
||||
|
||||
/**
|
||||
* The ThreadLocalTargetSource prefix.
|
||||
*/
|
||||
public static final String PREFIX_THREAD_LOCAL = "%";
|
||||
|
||||
/**
|
||||
* The PrototypeTargetSource prefix.
|
||||
*/
|
||||
public static final String PREFIX_PROTOTYPE = "!";
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -62,7 +62,7 @@ public abstract class ExposeBeanNameAdvisors {
|
||||
/**
|
||||
* Find the bean name for the given invocation. Assumes that an ExposeBeanNameAdvisor
|
||||
* has been included in the interceptor chain.
|
||||
* @param mi MethodInvocation that should contain the bean name as an attribute
|
||||
* @param mi the MethodInvocation that should contain the bean name as an attribute
|
||||
* @return the bean name (never {@code null})
|
||||
* @throws IllegalStateException if the bean name has not been exposed
|
||||
*/
|
||||
@@ -80,7 +80,7 @@ public abstract class ExposeBeanNameAdvisors {
|
||||
|
||||
/**
|
||||
* Create a new advisor that will expose the given bean name,
|
||||
* with no introduction
|
||||
* with no introduction.
|
||||
* @param beanName bean name to expose
|
||||
*/
|
||||
public static Advisor createAdvisorWithoutIntroduction(String beanName) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -43,7 +43,7 @@ import org.springframework.core.PriorityOrdered;
|
||||
@SuppressWarnings("serial")
|
||||
public class ExposeInvocationInterceptor implements MethodInterceptor, PriorityOrdered, Serializable {
|
||||
|
||||
/** Singleton instance of this class */
|
||||
/** Singleton instance of this class. */
|
||||
public static final ExposeInvocationInterceptor INSTANCE = new ExposeInvocationInterceptor();
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -54,14 +54,14 @@ import org.springframework.util.ClassUtils;
|
||||
@SuppressWarnings("serial")
|
||||
public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean<Object>, BeanFactoryAware {
|
||||
|
||||
/** The TargetSource that manages scoping */
|
||||
/** The TargetSource that manages scoping. */
|
||||
private final SimpleBeanTargetSource scopedTargetSource = new SimpleBeanTargetSource();
|
||||
|
||||
/** The name of the target bean */
|
||||
/** The name of the target bean. */
|
||||
@Nullable
|
||||
private String targetBeanName;
|
||||
|
||||
/** The cached singleton proxy */
|
||||
/** The cached singleton proxy. */
|
||||
@Nullable
|
||||
private Object proxy;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -39,7 +39,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class ComposablePointcut implements Pointcut, Serializable {
|
||||
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability */
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability. */
|
||||
private static final long serialVersionUID = -2743223737633663832L;
|
||||
|
||||
private ClassFilter classFilter;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -24,6 +24,8 @@ import org.springframework.lang.Nullable;
|
||||
/**
|
||||
* Convenient abstract superclass for dynamic method matchers,
|
||||
* which do care about arguments at runtime.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
public abstract class DynamicMethodMatcher implements MethodMatcher {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -35,10 +35,10 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public abstract class Pointcuts {
|
||||
|
||||
/** Pointcut matching all bean property setters, in any class */
|
||||
/** Pointcut matching all bean property setters, in any class. */
|
||||
public static final Pointcut SETTERS = SetterPointcut.INSTANCE;
|
||||
|
||||
/** Pointcut matching all bean property getters, in any class */
|
||||
/** Pointcut matching all bean property getters, in any class. */
|
||||
public static final Pointcut GETTERS = GetterPointcut.INSTANCE;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -21,7 +21,8 @@ import java.io.Serializable;
|
||||
import org.springframework.aop.ClassFilter;
|
||||
|
||||
/**
|
||||
* Simple ClassFilter implementation that passes classes (and optionally subclasses)
|
||||
* Simple ClassFilter implementation that passes classes (and optionally subclasses).
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -24,6 +24,8 @@ import org.springframework.lang.Nullable;
|
||||
/**
|
||||
* Convenient abstract superclass for static method matchers, which don't care
|
||||
* about arguments at runtime.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
*/
|
||||
public abstract class StaticMethodMatcher implements MethodMatcher {
|
||||
|
||||
|
||||
@@ -49,17 +49,17 @@ import org.springframework.util.ObjectUtils;
|
||||
*/
|
||||
public abstract class AbstractBeanFactoryBasedTargetSource implements TargetSource, BeanFactoryAware, Serializable {
|
||||
|
||||
/** use serialVersionUID from Spring 1.2.7 for interoperability */
|
||||
/** use serialVersionUID from Spring 1.2.7 for interoperability. */
|
||||
private static final long serialVersionUID = -4721607536018568393L;
|
||||
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
/** Name of the target bean we will create on each invocation */
|
||||
/** Name of the target bean we will create on each invocation. */
|
||||
private String targetBeanName;
|
||||
|
||||
/** Class of the target */
|
||||
/** Class of the target. */
|
||||
private volatile Class<?> targetClass;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -42,10 +42,10 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public abstract class AbstractLazyCreationTargetSource implements TargetSource {
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
/** The lazily initialized target object */
|
||||
/** The lazily initialized target object. */
|
||||
private Object lazyTarget;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -55,7 +55,7 @@ import org.springframework.lang.Nullable;
|
||||
public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBasedTargetSource
|
||||
implements PoolingConfig, DisposableBean {
|
||||
|
||||
/** The maximum size of the pool */
|
||||
/** The maximum size of the pool. */
|
||||
private int maxSize = -1;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -79,7 +79,7 @@ public class CommonsPool2TargetSource extends AbstractPoolingTargetSource implem
|
||||
private boolean blockWhenExhausted = GenericObjectPoolConfig.DEFAULT_BLOCK_WHEN_EXHAUSTED;
|
||||
|
||||
/**
|
||||
* The Apache Commons {@code ObjectPool} used to pool target objects
|
||||
* The Apache Commons {@code ObjectPool} used to pool target objects.
|
||||
*/
|
||||
@Nullable
|
||||
private ObjectPool pool;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -32,7 +32,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*/
|
||||
public class EmptyTargetSource implements TargetSource, Serializable {
|
||||
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability */
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability. */
|
||||
private static final long serialVersionUID = 3680494563553489691L;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -37,11 +37,11 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class HotSwappableTargetSource implements TargetSource, Serializable {
|
||||
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability */
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability. */
|
||||
private static final long serialVersionUID = 7497929212653839187L;
|
||||
|
||||
|
||||
/** The current target object */
|
||||
/** The current target object. */
|
||||
private Object target;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -37,11 +37,11 @@ import org.springframework.util.ObjectUtils;
|
||||
*/
|
||||
public class SingletonTargetSource implements TargetSource, Serializable {
|
||||
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability */
|
||||
/** use serialVersionUID from Spring 1.2 for interoperability. */
|
||||
private static final long serialVersionUID = 9031246629662423738L;
|
||||
|
||||
|
||||
/** Target cached and invoked using reflection */
|
||||
/** Target cached and invoked using reflection. */
|
||||
private final Object target;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -39,7 +39,7 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public abstract class AbstractRefreshableTargetSource implements TargetSource, Refreshable {
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -39,6 +39,9 @@ import org.springframework.context.annotation.Role;
|
||||
@Configuration
|
||||
public class SpringConfiguredConfiguration {
|
||||
|
||||
/**
|
||||
* The bean name used for the configurer aspect.
|
||||
*/
|
||||
public static final String BEAN_CONFIGURER_ASPECT_BEAN_NAME =
|
||||
"org.springframework.context.config.internalBeanConfigurerAspect";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -86,7 +86,7 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
|
||||
@Nullable
|
||||
Object rootObject;
|
||||
|
||||
/** Map with cached nested Accessors: nested path -> Accessor instance */
|
||||
/** Map with cached nested Accessors: nested path -> Accessor instance. */
|
||||
@Nullable
|
||||
private Map<String, AbstractNestablePropertyAccessor> nestedPropertyAccessors;
|
||||
|
||||
@@ -971,6 +971,9 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A handler for a specific property.
|
||||
*/
|
||||
protected abstract static class PropertyHandler {
|
||||
|
||||
private final Class<?> propertyType;
|
||||
@@ -1026,6 +1029,9 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Holder class used to store property tokens.
|
||||
*/
|
||||
protected static class PropertyTokenHolder {
|
||||
|
||||
public PropertyTokenHolder(String name) {
|
||||
|
||||
@@ -401,7 +401,8 @@ public abstract class BeanUtils {
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the JavaBeans {@code PropertyDescriptor}s of a given class.
|
||||
* Retrieve the JavaBeans {@code PropertyDescriptor}s of a given
|
||||
* class.
|
||||
* @param clazz the Class to retrieve the PropertyDescriptors for
|
||||
* @return an array of {@code PropertyDescriptors} for the given class
|
||||
* @throws BeansException if PropertyDescriptor look fails
|
||||
|
||||
@@ -70,7 +70,7 @@ public class BeanWrapperImpl extends AbstractNestablePropertyAccessor implements
|
||||
private CachedIntrospectionResults cachedIntrospectionResults;
|
||||
|
||||
/**
|
||||
* The security context used for invoking the property methods
|
||||
* The security context used for invoking the property methods.
|
||||
*/
|
||||
@Nullable
|
||||
private AccessControlContext acc;
|
||||
|
||||
@@ -96,7 +96,7 @@ public class CachedIntrospectionResults {
|
||||
private static final boolean shouldIntrospectorIgnoreBeaninfoClasses =
|
||||
SpringProperties.getFlag(IGNORE_BEANINFO_PROPERTY_NAME);
|
||||
|
||||
/** Stores the BeanInfoFactory instances */
|
||||
/** Stores the BeanInfoFactory instances. */
|
||||
private static List<BeanInfoFactory> beanInfoFactories = SpringFactoriesLoader.loadFactories(
|
||||
BeanInfoFactory.class, CachedIntrospectionResults.class.getClassLoader());
|
||||
|
||||
@@ -250,13 +250,13 @@ public class CachedIntrospectionResults {
|
||||
}
|
||||
|
||||
|
||||
/** The BeanInfo object for the introspected bean class */
|
||||
/** The BeanInfo object for the introspected bean class. */
|
||||
private final BeanInfo beanInfo;
|
||||
|
||||
/** PropertyDescriptor objects keyed by property name String */
|
||||
/** PropertyDescriptor objects keyed by property name String. */
|
||||
private final Map<String, PropertyDescriptor> propertyDescriptorCache;
|
||||
|
||||
/** TypeDescriptor objects keyed by PropertyDescriptor */
|
||||
/** TypeDescriptor objects keyed by PropertyDescriptor. */
|
||||
private final ConcurrentMap<PropertyDescriptor, TypeDescriptor> typeDescriptorCache;
|
||||
|
||||
|
||||
|
||||
@@ -213,9 +213,9 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
|
||||
|
||||
/**
|
||||
* Return the set of {@link PropertyDescriptor}s from the wrapped {@link BeanInfo}
|
||||
* object as well as {@code PropertyDescriptor}s for each non-void returning setter
|
||||
* method found during construction.
|
||||
* Return the set of {@link PropertyDescriptor PropertyDescriptors} from the wrapped
|
||||
* {@link BeanInfo} object as well as {@code PropertyDescriptor BeanInfo} object as well as {@code PropertyDescriptors}
|
||||
* for each non-void returning setter method found during construction.
|
||||
* @see #ExtendedBeanInfo(BeanInfo)
|
||||
*/
|
||||
@Override
|
||||
@@ -259,6 +259,9 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A simple {@link PropertyDescriptor}.
|
||||
*/
|
||||
static class SimplePropertyDescriptor extends PropertyDescriptor {
|
||||
|
||||
@Nullable
|
||||
@@ -350,6 +353,9 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A simple {@link IndexedPropertyDescriptor}.
|
||||
*/
|
||||
static class SimpleIndexedPropertyDescriptor extends IndexedPropertyDescriptor {
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -35,7 +35,7 @@ public class MethodInvocationException extends PropertyAccessException {
|
||||
|
||||
/**
|
||||
* Create a new MethodInvocationException.
|
||||
* @param propertyChangeEvent PropertyChangeEvent that resulted in an exception
|
||||
* @param propertyChangeEvent the PropertyChangeEvent that resulted in an exception
|
||||
* @param cause the Throwable raised by the invoked method
|
||||
*/
|
||||
public MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwable cause) {
|
||||
|
||||
@@ -80,7 +80,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
|
||||
|
||||
/**
|
||||
* Construct a new MutablePropertyValues object from a Map.
|
||||
* @param original Map with property values keyed by property name Strings
|
||||
* @param original a Map with property values keyed by property name Strings
|
||||
* @see #addPropertyValues(Map)
|
||||
*/
|
||||
public MutablePropertyValues(@Nullable Map<?, ?> original) {
|
||||
@@ -101,7 +101,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
|
||||
* PropertyValue objects as-is.
|
||||
* <p>This is a constructor for advanced usage scenarios.
|
||||
* It is not intended for typical programmatic use.
|
||||
* @param propertyValueList List of PropertyValue objects
|
||||
* @param propertyValueList a List of PropertyValue objects
|
||||
*/
|
||||
public MutablePropertyValues(@Nullable List<PropertyValue> propertyValueList) {
|
||||
this.propertyValueList =
|
||||
@@ -145,7 +145,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
|
||||
|
||||
/**
|
||||
* Add all property values from the given Map.
|
||||
* @param other Map with property values keyed by property name,
|
||||
* @param other a Map with property values keyed by property name,
|
||||
* which must be a String
|
||||
* @return this in order to allow for adding multiple property values in a chain
|
||||
*/
|
||||
@@ -160,7 +160,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
|
||||
/**
|
||||
* Add a PropertyValue object, replacing any existing one for the
|
||||
* corresponding property or getting merged with it (if applicable).
|
||||
* @param pv PropertyValue object to add
|
||||
* @param pv the PropertyValue object to add
|
||||
* @return this in order to allow for adding multiple property values in a chain
|
||||
*/
|
||||
public MutablePropertyValues addPropertyValue(PropertyValue pv) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -39,6 +39,11 @@ public interface PropertyAccessor {
|
||||
* Follows normal Java conventions: getFoo().getBar() would be "foo.bar".
|
||||
*/
|
||||
String NESTED_PROPERTY_SEPARATOR = ".";
|
||||
|
||||
/**
|
||||
* Path separator for nested properties.
|
||||
* Follows normal Java conventions: getFoo().getBar() would be "foo.bar".
|
||||
*/
|
||||
char NESTED_PROPERTY_SEPARATOR_CHAR = '.';
|
||||
|
||||
/**
|
||||
@@ -46,6 +51,11 @@ public interface PropertyAccessor {
|
||||
* indexed or mapped property like "person.addresses[0]".
|
||||
*/
|
||||
String PROPERTY_KEY_PREFIX = "[";
|
||||
|
||||
/**
|
||||
* Marker that indicates the start of a property key for an
|
||||
* indexed or mapped property like "person.addresses[0]".
|
||||
*/
|
||||
char PROPERTY_KEY_PREFIX_CHAR = '[';
|
||||
|
||||
/**
|
||||
@@ -53,6 +63,11 @@ public interface PropertyAccessor {
|
||||
* indexed or mapped property like "person.addresses[0]".
|
||||
*/
|
||||
String PROPERTY_KEY_SUFFIX = "]";
|
||||
|
||||
/**
|
||||
* Marker that indicates the end of a property key for an
|
||||
* indexed or mapped property like "person.addresses[0]".
|
||||
*/
|
||||
char PROPERTY_KEY_SUFFIX_CHAR = ']';
|
||||
|
||||
|
||||
@@ -141,7 +156,7 @@ public interface PropertyAccessor {
|
||||
* <p>Bulk updates from PropertyValues are more powerful: This method is
|
||||
* provided for convenience. Behavior will be identical to that of
|
||||
* the {@link #setPropertyValues(PropertyValues)} method.
|
||||
* @param map Map to take properties from. Contains property value objects,
|
||||
* @param map a Map to take properties from. Contains property value objects,
|
||||
* keyed by property name
|
||||
* @throws InvalidPropertyException if there is no such property or
|
||||
* if the property isn't writable
|
||||
@@ -162,7 +177,7 @@ public interface PropertyAccessor {
|
||||
* This exception can be examined later to see all binding errors.
|
||||
* Properties that were successfully updated remain changed.
|
||||
* <p>Does not allow unknown fields or invalid fields.
|
||||
* @param pvs PropertyValues to set on the target object
|
||||
* @param pvs a PropertyValues to set on the target object
|
||||
* @throws InvalidPropertyException if there is no such property or
|
||||
* if the property isn't writable
|
||||
* @throws PropertyBatchUpdateException if one or more PropertyAccessExceptions
|
||||
@@ -182,7 +197,7 @@ public interface PropertyAccessor {
|
||||
* {@link PropertyBatchUpdateException} containing all the individual errors.
|
||||
* This exception can be examined later to see all binding errors.
|
||||
* Properties that were successfully updated remain changed.
|
||||
* @param pvs PropertyValues to set on the target object
|
||||
* @param pvs a PropertyValues to set on the target object
|
||||
* @param ignoreUnknown should we ignore unknown properties (not found in the bean)
|
||||
* @throws InvalidPropertyException if there is no such property or
|
||||
* if the property isn't writable
|
||||
@@ -204,7 +219,7 @@ public interface PropertyAccessor {
|
||||
* {@link PropertyBatchUpdateException} containing all the individual errors.
|
||||
* This exception can be examined later to see all binding errors.
|
||||
* Properties that were successfully updated remain changed.
|
||||
* @param pvs PropertyValues to set on the target object
|
||||
* @param pvs a PropertyValues to set on the target object
|
||||
* @param ignoreUnknown should we ignore unknown properties (not found in the bean)
|
||||
* @param ignoreInvalid should we ignore invalid properties (found but not accessible)
|
||||
* @throws InvalidPropertyException if there is no such property or
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -39,7 +39,7 @@ import org.springframework.util.ObjectUtils;
|
||||
@SuppressWarnings("serial")
|
||||
public class PropertyBatchUpdateException extends BeansException {
|
||||
|
||||
/** List of PropertyAccessException objects */
|
||||
/** List of PropertyAccessException objects. */
|
||||
private PropertyAccessException[] propertyAccessExceptions;
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public abstract class PropertyMatches {
|
||||
|
||||
/** Default maximum property distance: 2 */
|
||||
/** Default maximum property distance: 2. */
|
||||
public static final int DEFAULT_MAX_DISTANCE = 2;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -54,11 +54,11 @@ public class PropertyValue extends BeanMetadataAttributeAccessor implements Seri
|
||||
@Nullable
|
||||
private Object convertedValue;
|
||||
|
||||
/** Package-visible field that indicates whether conversion is necessary */
|
||||
/** Package-visible field that indicates whether conversion is necessary. */
|
||||
@Nullable
|
||||
volatile Boolean conversionNecessary;
|
||||
|
||||
/** Package-visible field for caching the resolved property path tokens */
|
||||
/** Package-visible field for caching the resolved property path tokens. */
|
||||
@Nullable
|
||||
transient volatile Object resolvedTokens;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -46,7 +46,7 @@ public interface PropertyValues {
|
||||
* Return the changes since the previous PropertyValues.
|
||||
* Subclasses should also override {@code equals}.
|
||||
* @param old old property values
|
||||
* @return PropertyValues updated or new properties.
|
||||
* @return the updated or new properties.
|
||||
* Return empty PropertyValues if there are no changes.
|
||||
* @see Object#equals
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -28,13 +28,13 @@ import org.springframework.util.ClassUtils;
|
||||
@SuppressWarnings("serial")
|
||||
public class BeanNotOfRequiredTypeException extends BeansException {
|
||||
|
||||
/** The name of the instance that was of the wrong type */
|
||||
/** The name of the instance that was of the wrong type. */
|
||||
private String beanName;
|
||||
|
||||
/** The required type */
|
||||
/** The required type. */
|
||||
private Class<?> requiredType;
|
||||
|
||||
/** The offending type */
|
||||
/** The offending type. */
|
||||
private Class<?> actualType;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -51,6 +51,7 @@ import org.springframework.lang.Nullable;
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
* @since 08.03.2003
|
||||
* @param <T> the bean type
|
||||
* @see org.springframework.beans.factory.BeanFactory
|
||||
* @see org.springframework.aop.framework.ProxyFactoryBean
|
||||
* @see org.springframework.jndi.JndiObjectFactoryBean
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -33,6 +33,7 @@ import org.springframework.beans.BeansException;
|
||||
*
|
||||
* @author Colin Sampaleanu
|
||||
* @since 1.0.2
|
||||
* @param <T> the object type
|
||||
* @see FactoryBean
|
||||
*/
|
||||
@FunctionalInterface
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -28,6 +28,7 @@ import org.springframework.lang.Nullable;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.3
|
||||
* @param <T> the object type
|
||||
*/
|
||||
public interface ObjectProvider<T> extends ObjectFactory<T> {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -35,6 +35,7 @@ package org.springframework.beans.factory;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0.3
|
||||
* @param <T> the bean type
|
||||
* @see #isPrototype()
|
||||
* @see #isSingleton()
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -94,6 +94,7 @@ public class InjectionMetadata {
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear property skipping for the contained elements.
|
||||
* @since 3.2.13
|
||||
*/
|
||||
public void clear(@Nullable PropertyValues pvs) {
|
||||
@@ -113,6 +114,9 @@ public class InjectionMetadata {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A single injected element.
|
||||
*/
|
||||
public abstract static class InjectedElement {
|
||||
|
||||
protected final Member member;
|
||||
@@ -226,6 +230,7 @@ public class InjectionMetadata {
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear property skipping for this element.
|
||||
* @since 3.2.13
|
||||
*/
|
||||
protected void clearPropertySkipping(@Nullable PropertyValues pvs) {
|
||||
|
||||
@@ -93,7 +93,7 @@ public class RequiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP
|
||||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
/**
|
||||
* Cache for validated bean names, skipping re-validation for the same bean
|
||||
* Cache for validated bean names, skipping re-validation for the same bean.
|
||||
*/
|
||||
private final Set<String> validatedBeanNames = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
|
||||
|
||||
|
||||
@@ -56,13 +56,14 @@ import org.springframework.util.ReflectionUtils;
|
||||
* @author Juergen Hoeller
|
||||
* @author Keith Donald
|
||||
* @since 1.0.2
|
||||
* @param <T> the bean type
|
||||
* @see #setSingleton
|
||||
* @see #createInstance()
|
||||
*/
|
||||
public abstract class AbstractFactoryBean<T>
|
||||
implements FactoryBean<T>, BeanClassLoaderAware, BeanFactoryAware, InitializingBean, DisposableBean {
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private boolean singleton = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -118,7 +118,7 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
|
||||
* {@link BeanPostProcessor BeanPostProcessors}.
|
||||
* <p>Note: This is intended for creating a fresh instance, populating annotated
|
||||
* fields and methods as well as applying all standard bean initialization callbacks.
|
||||
* It does <i>not</> imply traditional by-name or by-type autowiring of properties;
|
||||
* It does <i>not</i> imply traditional by-name or by-type autowiring of properties;
|
||||
* use {@link #createBean(Class, int, boolean)} for those purposes.
|
||||
* @param beanClass the class of the bean to create
|
||||
* @return the new bean instance
|
||||
|
||||
@@ -194,9 +194,9 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single
|
||||
* bean property values, constructor argument values, etc.
|
||||
* <p>This will override the default PropertyEditor mechanism and hence make
|
||||
* any custom editors or custom editor registrars irrelevant.
|
||||
* @since 2.5
|
||||
* @see #addPropertyEditorRegistrar
|
||||
* @see #registerCustomEditor
|
||||
* @since 2.5
|
||||
*/
|
||||
void setTypeConverter(TypeConverter typeConverter);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -68,10 +68,10 @@ import org.springframework.util.ClassUtils;
|
||||
*
|
||||
* <p>
|
||||
* Note, that you shouldn't register {@link PropertyEditor} bean instances via
|
||||
* the {@code customEditors} property as {@link PropertyEditor}s are stateful
|
||||
* the {@code customEditors} property as {@link PropertyEditor PropertyEditors} are stateful
|
||||
* and the instances will then have to be synchronized for every editing
|
||||
* attempt. In case you need control over the instantiation process of
|
||||
* {@link PropertyEditor}s, use a {@link PropertyEditorRegistrar} to register
|
||||
* {@link PropertyEditor PropertyEditors}, use a {@link PropertyEditorRegistrar} to register
|
||||
* them.
|
||||
*
|
||||
* <p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -35,14 +35,15 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* <p>Typically used for retrieving public static final constants. Usage example:
|
||||
*
|
||||
* <pre class="code">// standard definition for exposing a static field, specifying the "staticField" property
|
||||
* <pre class="code">
|
||||
* // standard definition for exposing a static field, specifying the "staticField" property
|
||||
* <bean id="myField" class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
|
||||
* <property name="staticField" value="java.sql.Connection.TRANSACTION_SERIALIZABLE"/>
|
||||
* </bean>
|
||||
*
|
||||
* // convenience version that specifies a static field pattern as bean name
|
||||
* <bean id="java.sql.Connection.TRANSACTION_SERIALIZABLE"
|
||||
* class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/></pre>
|
||||
* class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean"/>
|
||||
* </pre>
|
||||
*
|
||||
* <p>If you are using Spring 2.0, you can also use the following style of configuration for
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -87,7 +87,7 @@ public class MethodInvokingFactoryBean extends MethodInvokingBean implements Fac
|
||||
|
||||
private boolean initialized = false;
|
||||
|
||||
/** Method call result in the singleton case */
|
||||
/** Method call result in the singleton case. */
|
||||
@Nullable
|
||||
private Object singletonObject;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -24,6 +24,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.3.3
|
||||
* @param <T> the bean type
|
||||
* @see AutowireCapableBeanFactory#resolveNamedBean(Class)
|
||||
*/
|
||||
public class NamedBeanHolder<T> implements NamedBean {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -36,10 +36,10 @@ import org.springframework.util.StringValueResolver;
|
||||
* Example XML bean definition:
|
||||
*
|
||||
* <pre class="code">
|
||||
* <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
|
||||
* <property name="driverClassName" value="${driver}"/>
|
||||
* <property name="url" value="jdbc:${dbname}"/>
|
||||
* </bean>
|
||||
* <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
|
||||
* <property name="driverClassName" value="${driver}"/>
|
||||
* <property name="url" value="jdbc:${dbname}"/>
|
||||
* </bean>
|
||||
* </pre>
|
||||
*
|
||||
* Example properties file:
|
||||
@@ -89,23 +89,23 @@ import org.springframework.util.StringValueResolver;
|
||||
public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfigurer
|
||||
implements BeanNameAware, BeanFactoryAware {
|
||||
|
||||
/** Default placeholder prefix: {@value} */
|
||||
/** Default placeholder prefix: {@value}. */
|
||||
public static final String DEFAULT_PLACEHOLDER_PREFIX = "${";
|
||||
|
||||
/** Default placeholder suffix: {@value} */
|
||||
/** Default placeholder suffix: {@value}. */
|
||||
public static final String DEFAULT_PLACEHOLDER_SUFFIX = "}";
|
||||
|
||||
/** Default value separator: {@value} */
|
||||
/** Default value separator: {@value}. */
|
||||
public static final String DEFAULT_VALUE_SEPARATOR = ":";
|
||||
|
||||
|
||||
/** Defaults to {@value #DEFAULT_PLACEHOLDER_PREFIX} */
|
||||
/** Defaults to {@value #DEFAULT_PLACEHOLDER_PREFIX}. */
|
||||
protected String placeholderPrefix = DEFAULT_PLACEHOLDER_PREFIX;
|
||||
|
||||
/** Defaults to {@value #DEFAULT_PLACEHOLDER_SUFFIX} */
|
||||
/** Defaults to {@value #DEFAULT_PLACEHOLDER_SUFFIX}. */
|
||||
protected String placeholderSuffix = DEFAULT_PLACEHOLDER_SUFFIX;
|
||||
|
||||
/** Defaults to {@value #DEFAULT_VALUE_SEPARATOR} */
|
||||
/** Defaults to {@value #DEFAULT_VALUE_SEPARATOR}. */
|
||||
@Nullable
|
||||
protected String valueSeparator = DEFAULT_VALUE_SEPARATOR;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -64,6 +64,9 @@ import org.springframework.beans.factory.BeanInitializationException;
|
||||
*/
|
||||
public class PropertyOverrideConfigurer extends PropertyResourceConfigurer {
|
||||
|
||||
/**
|
||||
* The default bean name separator.
|
||||
*/
|
||||
public static final String DEFAULT_BEAN_NAME_SEPARATOR = ".";
|
||||
|
||||
|
||||
@@ -72,7 +75,7 @@ public class PropertyOverrideConfigurer extends PropertyResourceConfigurer {
|
||||
private boolean ignoreInvalidKeys = false;
|
||||
|
||||
/**
|
||||
* Contains names of beans that have overrides
|
||||
* Contains names of beans that have overrides.
|
||||
*/
|
||||
private final Set<String> beanNames = Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class YamlProcessor {
|
||||
/**
|
||||
* A map of document matchers allowing callers to selectively use only
|
||||
* some of the documents in a YAML resource. In YAML documents are
|
||||
* separated by <code>---<code> lines, and each document is converted
|
||||
* separated by {@code ---} lines, and each document is converted
|
||||
* to properties before the match is made. E.g.
|
||||
* <pre class="code">
|
||||
* environment: dev
|
||||
@@ -343,7 +343,7 @@ public abstract class YamlProcessor {
|
||||
|
||||
|
||||
/**
|
||||
* Status returned from {@link DocumentMatcher#matches(java.util.Properties)}
|
||||
* Status returned from {@link DocumentMatcher#matches(java.util.Properties)}.
|
||||
*/
|
||||
public enum MatchStatus {
|
||||
|
||||
|
||||
@@ -545,8 +545,8 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether there are any {@link RuntimeBeanReference}s inside the {@link Map}
|
||||
* and converts it to a {@link ManagedMap} if necessary.
|
||||
* Checks whether there are any {@link RuntimeBeanReference RuntimeBeanReferences}
|
||||
* inside the {@link Map} and converts it to a {@link ManagedMap} if necessary.
|
||||
* @param map the original Map
|
||||
* @return either the original map or a managed copy of it
|
||||
*/
|
||||
@@ -567,8 +567,8 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether there are any {@link RuntimeBeanReference}s inside the {@link List}
|
||||
* and converts it to a {@link ManagedList} if necessary.
|
||||
* Checks whether there are any {@link RuntimeBeanReference RuntimeBeanReferences}
|
||||
* inside the {@link List} and converts it to a {@link ManagedList} if necessary.
|
||||
* @param list the original List
|
||||
* @return either the original list or a managed copy of it
|
||||
*/
|
||||
@@ -630,7 +630,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
|
||||
|
||||
/**
|
||||
* This method overrides property retrieval in the scope of the
|
||||
* {@code GroovyBeanDefinitionReader} to either:
|
||||
* {@code GroovyBeanDefinitionReader}. A property retrieval will either:
|
||||
* <ul>
|
||||
* <li>Retrieve a variable from the bean builder's binding if it exists
|
||||
* <li>Retrieve a RuntimeBeanReference for a specific bean if it exists
|
||||
|
||||
@@ -122,14 +122,14 @@ import org.springframework.util.StringUtils;
|
||||
public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFactory
|
||||
implements AutowireCapableBeanFactory {
|
||||
|
||||
/** Strategy for creating bean instances */
|
||||
/** Strategy for creating bean instances. */
|
||||
private InstantiationStrategy instantiationStrategy = new CglibSubclassingInstantiationStrategy();
|
||||
|
||||
/** Resolver strategy for method parameter names */
|
||||
/** Resolver strategy for method parameter names. */
|
||||
@Nullable
|
||||
private ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
|
||||
|
||||
/** Whether to automatically try to resolve circular references between beans */
|
||||
/** Whether to automatically try to resolve circular references between beans. */
|
||||
private boolean allowCircularReferences = true;
|
||||
|
||||
/**
|
||||
@@ -156,10 +156,10 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
*/
|
||||
private final NamedThreadLocal<String> currentlyCreatedBean = new NamedThreadLocal<>("Currently created bean");
|
||||
|
||||
/** Cache of unfinished FactoryBean instances: FactoryBean name --> BeanWrapper */
|
||||
/** Cache of unfinished FactoryBean instances: FactoryBean name to BeanWrapper. */
|
||||
private final Map<String, BeanWrapper> factoryBeanInstanceCache = new ConcurrentHashMap<>(16);
|
||||
|
||||
/** Cache of filtered PropertyDescriptors: bean Class -> PropertyDescriptor array */
|
||||
/** Cache of filtered PropertyDescriptors: bean Class to PropertyDescriptor array. */
|
||||
private final ConcurrentMap<Class<?>, PropertyDescriptor[]> filteredPropertyDescriptorsCache =
|
||||
new ConcurrentHashMap<>(256);
|
||||
|
||||
@@ -871,7 +871,12 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
*/
|
||||
@Nullable
|
||||
private Class<?> getTypeForFactoryBeanFromMethod(Class<?> beanClass, final String factoryMethodName) {
|
||||
|
||||
/**
|
||||
* Holder used to keep a reference to a {@code Class} value.
|
||||
*/
|
||||
class Holder { @Nullable Class<?> value = null; }
|
||||
|
||||
final Holder objectType = new Holder();
|
||||
|
||||
// CGLIB subclass methods hide generic parameters; look at the original user class.
|
||||
@@ -1281,7 +1286,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
* from the bean definition.
|
||||
* @param beanName the name of the bean
|
||||
* @param mbd the bean definition for the bean
|
||||
* @param bw BeanWrapper with bean instance
|
||||
* @param bw the BeanWrapper with bean instance
|
||||
*/
|
||||
protected void populateBean(String beanName, RootBeanDefinition mbd, @Nullable BeanWrapper bw) {
|
||||
if (bw == null) {
|
||||
@@ -1370,7 +1375,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
* @param beanName the name of the bean we're wiring up.
|
||||
* Useful for debugging messages; not used functionally.
|
||||
* @param mbd bean definition to update through autowiring
|
||||
* @param bw BeanWrapper from which we can obtain information about the bean
|
||||
* @param bw the BeanWrapper from which we can obtain information about the bean
|
||||
* @param pvs the PropertyValues to register wired objects with
|
||||
*/
|
||||
protected void autowireByName(
|
||||
@@ -1404,7 +1409,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
* behavior for bigger applications.
|
||||
* @param beanName the name of the bean to autowire by type
|
||||
* @param mbd the merged bean definition to update through autowiring
|
||||
* @param bw BeanWrapper from which we can obtain information about the bean
|
||||
* @param bw the BeanWrapper from which we can obtain information about the bean
|
||||
* @param pvs the PropertyValues to register wired objects with
|
||||
*/
|
||||
protected void autowireByType(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -47,7 +47,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable, BeanDefinitionReader {
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final BeanDefinitionRegistry registry;
|
||||
|
||||
@@ -111,65 +111,65 @@ import org.springframework.util.StringValueResolver;
|
||||
*/
|
||||
public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport implements ConfigurableBeanFactory {
|
||||
|
||||
/** Parent bean factory, for bean inheritance support */
|
||||
/** Parent bean factory, for bean inheritance support. */
|
||||
@Nullable
|
||||
private BeanFactory parentBeanFactory;
|
||||
|
||||
/** ClassLoader to resolve bean class names with, if necessary */
|
||||
/** ClassLoader to resolve bean class names with, if necessary. */
|
||||
@Nullable
|
||||
private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
|
||||
|
||||
/** ClassLoader to temporarily resolve bean class names with, if necessary */
|
||||
/** ClassLoader to temporarily resolve bean class names with, if necessary. */
|
||||
@Nullable
|
||||
private ClassLoader tempClassLoader;
|
||||
|
||||
/** Whether to cache bean metadata or rather reobtain it for every access */
|
||||
/** Whether to cache bean metadata or rather reobtain it for every access. */
|
||||
private boolean cacheBeanMetadata = true;
|
||||
|
||||
/** Resolution strategy for expressions in bean definition values */
|
||||
/** Resolution strategy for expressions in bean definition values. */
|
||||
@Nullable
|
||||
private BeanExpressionResolver beanExpressionResolver;
|
||||
|
||||
/** Spring ConversionService to use instead of PropertyEditors */
|
||||
/** Spring ConversionService to use instead of PropertyEditors. */
|
||||
@Nullable
|
||||
private ConversionService conversionService;
|
||||
|
||||
/** Custom PropertyEditorRegistrars to apply to the beans of this factory */
|
||||
/** Custom PropertyEditorRegistrars to apply to the beans of this factory. */
|
||||
private final Set<PropertyEditorRegistrar> propertyEditorRegistrars = new LinkedHashSet<>(4);
|
||||
|
||||
/** Custom PropertyEditors to apply to the beans of this factory */
|
||||
/** Custom PropertyEditors to apply to the beans of this factory. */
|
||||
private final Map<Class<?>, Class<? extends PropertyEditor>> customEditors = new HashMap<>(4);
|
||||
|
||||
/** A custom TypeConverter to use, overriding the default PropertyEditor mechanism */
|
||||
/** A custom TypeConverter to use, overriding the default PropertyEditor mechanism. */
|
||||
@Nullable
|
||||
private TypeConverter typeConverter;
|
||||
|
||||
/** String resolvers to apply e.g. to annotation attribute values */
|
||||
/** String resolvers to apply e.g. to annotation attribute values. */
|
||||
private final List<StringValueResolver> embeddedValueResolvers = new LinkedList<>();
|
||||
|
||||
/** BeanPostProcessors to apply in createBean */
|
||||
/** BeanPostProcessors to apply in createBean. */
|
||||
private final List<BeanPostProcessor> beanPostProcessors = new ArrayList<>();
|
||||
|
||||
/** Indicates whether any InstantiationAwareBeanPostProcessors have been registered */
|
||||
/** Indicates whether any InstantiationAwareBeanPostProcessors have been registered. */
|
||||
private boolean hasInstantiationAwareBeanPostProcessors;
|
||||
|
||||
/** Indicates whether any DestructionAwareBeanPostProcessors have been registered */
|
||||
/** Indicates whether any DestructionAwareBeanPostProcessors have been registered. */
|
||||
private boolean hasDestructionAwareBeanPostProcessors;
|
||||
|
||||
/** Map from scope identifier String to corresponding Scope */
|
||||
/** Map from scope identifier String to corresponding Scope. */
|
||||
private final Map<String, Scope> scopes = new LinkedHashMap<>(8);
|
||||
|
||||
/** Security context used when running with a SecurityManager */
|
||||
/** Security context used when running with a SecurityManager. */
|
||||
@Nullable
|
||||
private SecurityContextProvider securityContextProvider;
|
||||
|
||||
/** Map from bean name to merged RootBeanDefinition */
|
||||
/** Map from bean name to merged RootBeanDefinition. */
|
||||
private final Map<String, RootBeanDefinition> mergedBeanDefinitions = new ConcurrentHashMap<>(256);
|
||||
|
||||
/** Names of beans that have already been created at least once */
|
||||
/** Names of beans that have already been created at least once. */
|
||||
private final Set<String> alreadyCreated = Collections.newSetFromMap(new ConcurrentHashMap<>(256));
|
||||
|
||||
/** Names of beans that are currently in creation */
|
||||
/** Names of beans that are currently in creation. */
|
||||
private final ThreadLocal<Object> prototypesCurrentlyInCreation =
|
||||
new NamedThreadLocal<>("Prototype beans currently in creation");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -32,6 +32,9 @@ import org.springframework.util.Assert;
|
||||
@SuppressWarnings("serial")
|
||||
public class AutowireCandidateQualifier extends BeanMetadataAttributeAccessor {
|
||||
|
||||
/**
|
||||
* The name of the key used to store the value.
|
||||
*/
|
||||
public static final String VALUE_KEY = "value";
|
||||
|
||||
private final String typeName;
|
||||
|
||||
@@ -131,50 +131,50 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
}
|
||||
|
||||
|
||||
/** Map from serialized id to factory instance */
|
||||
/** Map from serialized id to factory instance. */
|
||||
private static final Map<String, Reference<DefaultListableBeanFactory>> serializableFactories =
|
||||
new ConcurrentHashMap<>(8);
|
||||
|
||||
/** Optional id for this factory, for serialization purposes */
|
||||
/** Optional id for this factory, for serialization purposes. */
|
||||
@Nullable
|
||||
private String serializationId;
|
||||
|
||||
/** Whether to allow re-registration of a different definition with the same name */
|
||||
/** Whether to allow re-registration of a different definition with the same name. */
|
||||
private boolean allowBeanDefinitionOverriding = true;
|
||||
|
||||
/** Whether to allow eager class loading even for lazy-init beans */
|
||||
/** Whether to allow eager class loading even for lazy-init beans. */
|
||||
private boolean allowEagerClassLoading = true;
|
||||
|
||||
/** Optional OrderComparator for dependency Lists and arrays */
|
||||
/** Optional OrderComparator for dependency Lists and arrays. */
|
||||
@Nullable
|
||||
private Comparator<Object> dependencyComparator;
|
||||
|
||||
/** Resolver to use for checking if a bean definition is an autowire candidate */
|
||||
/** Resolver to use for checking if a bean definition is an autowire candidate. */
|
||||
private AutowireCandidateResolver autowireCandidateResolver = new SimpleAutowireCandidateResolver();
|
||||
|
||||
/** Map from dependency type to corresponding autowired value */
|
||||
/** Map from dependency type to corresponding autowired value. */
|
||||
private final Map<Class<?>, Object> resolvableDependencies = new ConcurrentHashMap<>(16);
|
||||
|
||||
/** Map of bean definition objects, keyed by bean name */
|
||||
/** Map of bean definition objects, keyed by bean name. */
|
||||
private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>(256);
|
||||
|
||||
/** Map of singleton and non-singleton bean names, keyed by dependency type */
|
||||
/** Map of singleton and non-singleton bean names, keyed by dependency type. */
|
||||
private final Map<Class<?>, String[]> allBeanNamesByType = new ConcurrentHashMap<>(64);
|
||||
|
||||
/** Map of singleton-only bean names, keyed by dependency type */
|
||||
/** Map of singleton-only bean names, keyed by dependency type. */
|
||||
private final Map<Class<?>, String[]> singletonBeanNamesByType = new ConcurrentHashMap<>(64);
|
||||
|
||||
/** List of bean definition names, in registration order */
|
||||
/** List of bean definition names, in registration order. */
|
||||
private volatile List<String> beanDefinitionNames = new ArrayList<>(256);
|
||||
|
||||
/** List of names of manually registered singletons, in registration order */
|
||||
/** List of names of manually registered singletons, in registration order. */
|
||||
private volatile Set<String> manualSingletonNames = new LinkedHashSet<>(16);
|
||||
|
||||
/** Cached array of bean definition names in case of frozen configuration */
|
||||
/** Cached array of bean definition names in case of frozen configuration. */
|
||||
@Nullable
|
||||
private volatile String[] frozenBeanDefinitionNames;
|
||||
|
||||
/** Whether bean definition metadata may be cached for all beans */
|
||||
/** Whether bean definition metadata may be cached for all beans. */
|
||||
private volatile boolean configurationFrozen = false;
|
||||
|
||||
|
||||
|
||||
@@ -70,43 +70,43 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements SingletonBeanRegistry {
|
||||
|
||||
/** Cache of singleton objects: bean name --> bean instance */
|
||||
/** Cache of singleton objects: bean name to bean instance. */
|
||||
private final Map<String, Object> singletonObjects = new ConcurrentHashMap<>(256);
|
||||
|
||||
/** Cache of singleton factories: bean name --> ObjectFactory */
|
||||
/** Cache of singleton factories: bean name to ObjectFactory. */
|
||||
private final Map<String, ObjectFactory<?>> singletonFactories = new HashMap<>(16);
|
||||
|
||||
/** Cache of early singleton objects: bean name --> bean instance */
|
||||
/** Cache of early singleton objects: bean name to bean instance. */
|
||||
private final Map<String, Object> earlySingletonObjects = new HashMap<>(16);
|
||||
|
||||
/** Set of registered singletons, containing the bean names in registration order */
|
||||
/** Set of registered singletons, containing the bean names in registration order. */
|
||||
private final Set<String> registeredSingletons = new LinkedHashSet<>(256);
|
||||
|
||||
/** Names of beans that are currently in creation */
|
||||
/** Names of beans that are currently in creation. */
|
||||
private final Set<String> singletonsCurrentlyInCreation =
|
||||
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||
|
||||
/** Names of beans currently excluded from in creation checks */
|
||||
/** Names of beans currently excluded from in creation checks. */
|
||||
private final Set<String> inCreationCheckExclusions =
|
||||
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||
|
||||
/** List of suppressed Exceptions, available for associating related causes */
|
||||
/** List of suppressed Exceptions, available for associating related causes. */
|
||||
@Nullable
|
||||
private Set<Exception> suppressedExceptions;
|
||||
|
||||
/** Flag that indicates whether we're currently within destroySingletons */
|
||||
/** Flag that indicates whether we're currently within destroySingletons. */
|
||||
private boolean singletonsCurrentlyInDestruction = false;
|
||||
|
||||
/** Disposable bean instances: bean name --> disposable instance */
|
||||
/** Disposable bean instances: bean name to disposable instance. */
|
||||
private final Map<String, Object> disposableBeans = new LinkedHashMap<>();
|
||||
|
||||
/** Map between containing bean names: bean name --> Set of bean names that the bean contains */
|
||||
/** Map between containing bean names: bean name to Set of bean names that the bean contains. */
|
||||
private final Map<String, Set<String>> containedBeanMap = new ConcurrentHashMap<>(16);
|
||||
|
||||
/** Map between dependent bean names: bean name --> Set of dependent bean names */
|
||||
/** Map between dependent bean names: bean name to Set of dependent bean names. */
|
||||
private final Map<String, Set<String>> dependentBeanMap = new ConcurrentHashMap<>(64);
|
||||
|
||||
/** Map between depending bean names: bean name --> Set of bean names for the bean's dependencies */
|
||||
/** Map between depending bean names: bean name to Set of bean names for the bean's dependencies. */
|
||||
private final Map<String, Set<String>> dependenciesForBeanMap = new ConcurrentHashMap<>(64);
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.lang.Nullable;
|
||||
*/
|
||||
public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanRegistry {
|
||||
|
||||
/** Cache of singleton objects created by FactoryBeans: FactoryBean name --> object */
|
||||
/** Cache of singleton objects created by FactoryBeans: FactoryBean name to object. */
|
||||
private final Map<String, Object> factoryBeanObjectCache = new ConcurrentHashMap<>(16);
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
|
||||
@SuppressWarnings("serial")
|
||||
public class ManagedArray extends ManagedList<Object> {
|
||||
|
||||
/** Resolved element type for runtime creation of the target array */
|
||||
/** Resolved element type for runtime creation of the target array. */
|
||||
@Nullable
|
||||
volatile Class<?> resolvedElementType;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -31,6 +31,7 @@ import org.springframework.lang.Nullable;
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
* @since 27.05.2003
|
||||
* @param <E> the element type
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ManagedList<E> extends ArrayList<E> implements Mergeable, BeanMetadataElement {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -30,6 +30,8 @@ import org.springframework.lang.Nullable;
|
||||
* @author Juergen Hoeller
|
||||
* @author Rob Harrop
|
||||
* @since 27.05.2003
|
||||
* @param <K> the key type
|
||||
* @param <V> the value type
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ManagedMap<K, V> extends LinkedHashMap<K, V> implements Mergeable, BeanMetadataElement {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -30,6 +30,7 @@ import org.springframework.lang.Nullable;
|
||||
* @author Juergen Hoeller
|
||||
* @author Rob Harrop
|
||||
* @since 21.01.2004
|
||||
* @param <E> the element type
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ManagedSet<E> extends LinkedHashSet<E> implements Mergeable, BeanMetadataElement {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -76,7 +76,7 @@ public class MethodOverrides {
|
||||
|
||||
/**
|
||||
* Return all method overrides contained by this object.
|
||||
* @return Set of MethodOverride objects
|
||||
* @return a Set of MethodOverride objects
|
||||
* @see MethodOverride
|
||||
*/
|
||||
public Set<MethodOverride> getOverrides() {
|
||||
|
||||
@@ -89,7 +89,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
|
||||
public static final String SEPARATOR = ".";
|
||||
|
||||
/**
|
||||
* Special key to distinguish {@code owner.(class)=com.myapp.MyClass}-
|
||||
* Special key to distinguish {@code owner.(class)=com.myapp.MyClass}.
|
||||
*/
|
||||
public static final String CLASS_KEY = "(class)";
|
||||
|
||||
@@ -299,10 +299,10 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
|
||||
|
||||
|
||||
/**
|
||||
* Register bean definitions contained in a Map,
|
||||
* using all property keys (i.e. not filtering by prefix).
|
||||
* @param map Map: name -> property (String or Object). Property values
|
||||
* will be strings if coming from a Properties file etc. Property names
|
||||
* Register bean definitions contained in a Map, using all property keys (i.e. not
|
||||
* filtering by prefix).
|
||||
* @param map a map of {@code name} to {@code property} (String or Object). Property
|
||||
* values will be strings if coming from a Properties file etc. Property names
|
||||
* (keys) <b>must</b> be Strings. Class keys must be Strings.
|
||||
* @return the number of bean definitions found
|
||||
* @throws BeansException in case of loading or parsing errors
|
||||
@@ -315,8 +315,8 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
|
||||
/**
|
||||
* Register bean definitions contained in a Map.
|
||||
* Ignore ineligible properties.
|
||||
* @param map Map name -> property (String or Object). Property values
|
||||
* will be strings if coming from a Properties file etc. Property names
|
||||
* @param map a map of {@code name} to {@code property} (String or Object). Property
|
||||
* values will be strings if coming from a Properties file etc. Property names
|
||||
* (keys) <b>must</b> be Strings. Class keys must be Strings.
|
||||
* @param prefix a filter within the keys in the map: e.g. 'beans.'
|
||||
* (can be empty or {@code null})
|
||||
@@ -330,9 +330,9 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
|
||||
/**
|
||||
* Register bean definitions contained in a Map.
|
||||
* Ignore ineligible properties.
|
||||
* @param map Map name -> property (String or Object). Property values
|
||||
* will be strings if coming from a Properties file etc. Property names
|
||||
* (keys) <b>must</b> be strings. Class keys must be Strings.
|
||||
* @param map a map of {@code name} to {@code property} (String or Object). Property
|
||||
* values will be strings if coming from a Properties file etc. Property names
|
||||
* (keys) <b>must</b> be Strings. Class keys must be Strings.
|
||||
* @param prefix a filter within the keys in the map: e.g. 'beans.'
|
||||
* (can be empty or {@code null})
|
||||
* @param resourceDescription description of the resource that the
|
||||
@@ -392,9 +392,9 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
|
||||
|
||||
/**
|
||||
* Get all property values, given a prefix (which will be stripped)
|
||||
* and add the bean they define to the factory with the given name
|
||||
* and add the bean they define to the factory with the given name.
|
||||
* @param beanName name of the bean to define
|
||||
* @param map Map containing string pairs
|
||||
* @param map a Map containing string pairs
|
||||
* @param prefix prefix of each entry, which will be stripped
|
||||
* @param resourceDescription description of the resource that the
|
||||
* Map came from (for logging purposes)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -66,39 +66,39 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
|
||||
@Nullable
|
||||
volatile ResolvableType targetType;
|
||||
|
||||
/** Package-visible field for caching the determined Class of a given bean definition */
|
||||
/** Package-visible field for caching the determined Class of a given bean definition. */
|
||||
@Nullable
|
||||
volatile Class<?> resolvedTargetType;
|
||||
|
||||
/** Package-visible field for caching the return type of a generically typed factory method */
|
||||
/** Package-visible field for caching the return type of a generically typed factory method. */
|
||||
@Nullable
|
||||
volatile ResolvableType factoryMethodReturnType;
|
||||
|
||||
/** Common lock for the four constructor fields below */
|
||||
/** Common lock for the four constructor fields below. */
|
||||
final Object constructorArgumentLock = new Object();
|
||||
|
||||
/** Package-visible field for caching the resolved constructor or factory method */
|
||||
/** Package-visible field for caching the resolved constructor or factory method. */
|
||||
@Nullable
|
||||
Executable resolvedConstructorOrFactoryMethod;
|
||||
|
||||
/** Package-visible field that marks the constructor arguments as resolved */
|
||||
/** Package-visible field that marks the constructor arguments as resolved. */
|
||||
boolean constructorArgumentsResolved = false;
|
||||
|
||||
/** Package-visible field for caching fully resolved constructor arguments */
|
||||
/** Package-visible field for caching fully resolved constructor arguments. */
|
||||
@Nullable
|
||||
Object[] resolvedConstructorArguments;
|
||||
|
||||
/** Package-visible field for caching partly prepared constructor arguments */
|
||||
/** Package-visible field for caching partly prepared constructor arguments. */
|
||||
@Nullable
|
||||
Object[] preparedConstructorArguments;
|
||||
|
||||
/** Common lock for the two post-processing fields below */
|
||||
/** Common lock for the two post-processing fields below. */
|
||||
final Object postProcessingLock = new Object();
|
||||
|
||||
/** Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied */
|
||||
/** Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied. */
|
||||
boolean postProcessed = false;
|
||||
|
||||
/** Package-visible field that indicates a before-instantiation post-processor having kicked in */
|
||||
/** Package-visible field that indicates a before-instantiation post-processor having kicked in. */
|
||||
@Nullable
|
||||
volatile Boolean beforeInstantiationResolved;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements BeanDefinitionRegistry {
|
||||
|
||||
/** Map of bean definition objects, keyed by bean name */
|
||||
/** Map of bean definition objects, keyed by bean name. */
|
||||
private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>(64);
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class StaticListableBeanFactory implements ListableBeanFactory {
|
||||
|
||||
/** Map from bean name to bean instance */
|
||||
/** Map from bean name to bean instance. */
|
||||
private final Map<String, Object> beans;
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.springframework.util.ClassUtils;
|
||||
*/
|
||||
public class BeanConfigurerSupport implements BeanFactoryAware, InitializingBean, DisposableBean {
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -50,10 +50,10 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public abstract class AbstractBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
/** Constant for the "id" attribute */
|
||||
/** Constant for the "id" attribute. */
|
||||
public static final String ID_ATTRIBUTE = "id";
|
||||
|
||||
/** Constant for the "name" attribute */
|
||||
/** Constant for the "name" attribute. */
|
||||
public static final String NAME_ATTRIBUTE = "name";
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -312,7 +312,7 @@ public class BeanDefinitionParserDelegate {
|
||||
/**
|
||||
* Populate the given DocumentDefaultsDefinition instance with the default lazy-init,
|
||||
* autowire, dependency check settings, init-method, destroy-method and merge settings.
|
||||
* Support nested 'beans' element use cases by falling back to <literal>parentDefaults</literal>
|
||||
* Support nested 'beans' element use cases by falling back to {@code parentDefaults}
|
||||
* in case the defaults are not explicitly set locally.
|
||||
* @param defaults the defaults to populate
|
||||
* @param parentDefaults the parent BeanDefinitionParserDelegate (if any) defaults to fall back to
|
||||
|
||||
@@ -55,17 +55,17 @@ public class DefaultNamespaceHandlerResolver implements NamespaceHandlerResolver
|
||||
public static final String DEFAULT_HANDLER_MAPPINGS_LOCATION = "META-INF/spring.handlers";
|
||||
|
||||
|
||||
/** Logger available to subclasses */
|
||||
/** Logger available to subclasses. */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
/** ClassLoader to use for NamespaceHandler classes */
|
||||
/** ClassLoader to use for NamespaceHandler classes. */
|
||||
@Nullable
|
||||
private final ClassLoader classLoader;
|
||||
|
||||
/** Resource location to search for */
|
||||
/** Resource location to search for. */
|
||||
private final String handlerMappingsLocation;
|
||||
|
||||
/** Stores the mappings from namespace URI to NamespaceHandler class name / instance */
|
||||
/** Stores the mappings from namespace URI to NamespaceHandler class name / instance. */
|
||||
@Nullable
|
||||
private volatile Map<String, Object> handlerMappings;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -38,10 +38,10 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class DelegatingEntityResolver implements EntityResolver {
|
||||
|
||||
/** Suffix for DTD files */
|
||||
/** Suffix for DTD files. */
|
||||
public static final String DTD_SUFFIX = ".dtd";
|
||||
|
||||
/** Suffix for schema definition files */
|
||||
/** Suffix for schema definition files. */
|
||||
public static final String XSD_SUFFIX = ".xsd";
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -71,7 +71,7 @@ public class PluggableSchemaResolver implements EntityResolver {
|
||||
|
||||
private final String schemaMappingsLocation;
|
||||
|
||||
/** Stores the mapping of schema URL -> local schema path */
|
||||
/** Stores the mapping of schema URL -> local schema path. */
|
||||
@Nullable
|
||||
private volatile Map<String, String> schemaMappings;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -98,7 +98,7 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader {
|
||||
public static final int VALIDATION_XSD = XmlValidationModeDetector.VALIDATION_XSD;
|
||||
|
||||
|
||||
/** Constants instance for this class */
|
||||
/** Constants instance for this class. */
|
||||
private static final Constants constants = new Constants(XmlBeanDefinitionReader.class);
|
||||
|
||||
private int validationMode = VALIDATION_AUTO;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user