Fix javadoc warnings
Before this change there were numerous javadoc warnings being reported while building Spring framework API. This commit resolves most of the javadoc warnings, reducing the total number from 265 to 103. Issue: SPR-9113
This commit is contained in:
parent
e830511e8a
commit
effb762558
|
|
@ -32,7 +32,7 @@ import org.springframework.util.ReflectionUtils;
|
||||||
/**
|
/**
|
||||||
* AOP Alliance <code>MethodInterceptor</code> that processes method invocations
|
* AOP Alliance <code>MethodInterceptor</code> that processes method invocations
|
||||||
* asynchronously, using a given {@link org.springframework.core.task.AsyncTaskExecutor}.
|
* asynchronously, using a given {@link org.springframework.core.task.AsyncTaskExecutor}.
|
||||||
* Typically used with the {@link org.springframework.context.task.Async} annotation.
|
* Typically used with the {@link org.springframework.scheduling.annotation.Async} annotation.
|
||||||
*
|
*
|
||||||
* <p>In terms of target method signatures, any parameter types are supported.
|
* <p>In terms of target method signatures, any parameter types are supported.
|
||||||
* However, the return type is constrained to either <code>void</code> or
|
* However, the return type is constrained to either <code>void</code> or
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -28,8 +28,9 @@ import org.springframework.beans.factory.DisposableBean;
|
||||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for dynamic {@link TargetSource} implementations that create new prototype
|
* Base class for dynamic {@link org.springframework.aop.TargetSource} implementations
|
||||||
* bean instances to support a pooling or new-instance-per-invocation strategy.
|
* that create new prototype bean instances to support a pooling or
|
||||||
|
* new-instance-per-invocation strategy.
|
||||||
*
|
*
|
||||||
* <p>Such TargetSources must run in a {@link BeanFactory}, as it needs to
|
* <p>Such TargetSources must run in a {@link BeanFactory}, as it needs to
|
||||||
* call the <code>getBean</code> method to create a new prototype instance.
|
* call the <code>getBean</code> method to create a new prototype instance.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -31,7 +31,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see EnableAsync
|
* @see EnableAsync
|
||||||
* @see AsyncConfigurationSelector
|
* @see org.springframework.scheduling.annotation.AsyncConfigurationSelector
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class AspectJAsyncConfiguration extends AbstractAsyncConfiguration {
|
public class AspectJAsyncConfiguration extends AbstractAsyncConfiguration {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -39,7 +39,7 @@ import java.lang.annotation.Target;
|
||||||
* a special case of such a general config method. Such config methods
|
* a special case of such a general config method. Such config methods
|
||||||
* do not have to be public.
|
* do not have to be public.
|
||||||
*
|
*
|
||||||
* <p>In the case of multiple argument methods, the 'required' parameter is
|
* <p>In the case of multiple argument methods, the 'required' parameter is
|
||||||
* applicable for all arguments.
|
* applicable for all arguments.
|
||||||
*
|
*
|
||||||
* <p>In case of a {@link java.util.Collection} or {@link java.util.Map}
|
* <p>In case of a {@link java.util.Collection} or {@link java.util.Map}
|
||||||
|
|
@ -52,8 +52,9 @@ import java.lang.annotation.Target;
|
||||||
* BeanPostProcessor} which in turn means that you <em>cannot</em>
|
* BeanPostProcessor} which in turn means that you <em>cannot</em>
|
||||||
* use {@code @Autowired} to inject references into
|
* use {@code @Autowired} to inject references into
|
||||||
* {@link org.springframework.beans.factory.config.BeanPostProcessor
|
* {@link org.springframework.beans.factory.config.BeanPostProcessor
|
||||||
* BeanPostProcessor} or {@link BeanFactoryPostProcessor} types. Please
|
* BeanPostProcessor} or
|
||||||
* consult the javadoc for the {@link AutowiredAnnotationBeanPostProcessor}
|
* {@link org.springframework.beans.factory.config.BeanFactoryPostProcessor BeanFactoryPostProcessor}
|
||||||
|
* types. Please consult the javadoc for the {@link AutowiredAnnotationBeanPostProcessor}
|
||||||
* class (which, by default, checks for the presence of this annotation).
|
* class (which, by default, checks for the presence of this annotation).
|
||||||
*
|
*
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -37,8 +37,9 @@ import java.lang.annotation.Target;
|
||||||
* BeanPostProcessor} which in turn means that you <em>cannot</em> use
|
* BeanPostProcessor} which in turn means that you <em>cannot</em> use
|
||||||
* {@code @Value} within
|
* {@code @Value} within
|
||||||
* {@link org.springframework.beans.factory.config.BeanPostProcessor
|
* {@link org.springframework.beans.factory.config.BeanPostProcessor
|
||||||
* BeanPostProcessor} or {@link BeanFactoryPostProcessor} types. Please
|
* BeanPostProcessor} or
|
||||||
* consult the javadoc for the {@link AutowiredAnnotationBeanPostProcessor}
|
* {@link org.springframework.beans.factory.config.BeanFactoryPostProcessor BeanFactoryPostProcessor}
|
||||||
|
* types. Please consult the javadoc for the {@link AutowiredAnnotationBeanPostProcessor}
|
||||||
* class (which, by default, checks for the presence of this annotation).
|
* class (which, by default, checks for the presence of this annotation).
|
||||||
*
|
*
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -36,8 +36,8 @@ import org.springframework.util.StringValueResolver;
|
||||||
*
|
*
|
||||||
*<pre class="code">{@code
|
*<pre class="code">{@code
|
||||||
*<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
|
*<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
|
||||||
* <property name="driverClassName" value="}${driver}{@code"/>
|
* <property name="driverClassName" value="}${driver}{@code "/>
|
||||||
* <property name="url" value="jdbc:}${dbname}{@code"/>
|
* <property name="url" value="jdbc:}${dbname}{@code "/>
|
||||||
*</bean>
|
*</bean>
|
||||||
*}</pre>
|
*}</pre>
|
||||||
*
|
*
|
||||||
|
|
@ -76,7 +76,7 @@ import org.springframework.util.StringValueResolver;
|
||||||
* <p>Example XML property with default value:
|
* <p>Example XML property with default value:
|
||||||
*
|
*
|
||||||
*<pre class="code">{@code
|
*<pre class="code">{@code
|
||||||
* <property name="url" value="jdbc:}${dbname:defaultdb}{@code"/>
|
* <property name="url" value="jdbc:}${dbname:defaultdb}{@code "/>
|
||||||
*}</pre>
|
*}</pre>
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -353,7 +353,7 @@ public class BeanDefinitionParserDelegate {
|
||||||
* <literal>parentDefaults</literal> in case the defaults are not explicitly set
|
* <literal>parentDefaults</literal> in case the defaults are not explicitly set
|
||||||
* locally.
|
* locally.
|
||||||
* @param defaults the defaults to populate
|
* @param defaults the defaults to populate
|
||||||
* @param defaults the parent BeanDefinitionParserDelegate (if any) defaults to fall back to
|
* @param parentDefaults the parent BeanDefinitionParserDelegate (if any) defaults to fall back to
|
||||||
* @param root the root element of the current bean definition document (or nested beans element)
|
* @param root the root element of the current bean definition document (or nested beans element)
|
||||||
*/
|
*/
|
||||||
protected void populateDefaults(DocumentDefaultsDefinition defaults, DocumentDefaultsDefinition parentDefaults, Element root) {
|
protected void populateDefaults(DocumentDefaultsDefinition defaults, DocumentDefaultsDefinition parentDefaults, Element root) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -34,7 +34,6 @@ import org.springframework.beans.propertyeditors.InputSourceEditor;
|
||||||
import org.springframework.beans.propertyeditors.InputStreamEditor;
|
import org.springframework.beans.propertyeditors.InputStreamEditor;
|
||||||
import org.springframework.beans.propertyeditors.URIEditor;
|
import org.springframework.beans.propertyeditors.URIEditor;
|
||||||
import org.springframework.beans.propertyeditors.URLEditor;
|
import org.springframework.beans.propertyeditors.URLEditor;
|
||||||
import org.springframework.core.env.Environment;
|
|
||||||
import org.springframework.core.env.PropertyResolver;
|
import org.springframework.core.env.PropertyResolver;
|
||||||
import org.springframework.core.env.StandardEnvironment;
|
import org.springframework.core.env.StandardEnvironment;
|
||||||
import org.springframework.core.io.ContextResource;
|
import org.springframework.core.io.ContextResource;
|
||||||
|
|
@ -71,7 +70,7 @@ public class ResourceEditorRegistrar implements PropertyEditorRegistrar {
|
||||||
* @see org.springframework.core.io.support.ResourcePatternResolver
|
* @see org.springframework.core.io.support.ResourcePatternResolver
|
||||||
* @see org.springframework.context.ApplicationContext
|
* @see org.springframework.context.ApplicationContext
|
||||||
* @deprecated as of Spring 3.1 in favor of
|
* @deprecated as of Spring 3.1 in favor of
|
||||||
* {@link #ResourceEditorRegistrar(ResourceLoader, Environment)}
|
* {@link #ResourceEditorRegistrar(ResourceLoader, PropertyResolver)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ResourceEditorRegistrar(ResourceLoader resourceLoader) {
|
public ResourceEditorRegistrar(ResourceLoader resourceLoader) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -56,9 +56,7 @@ import org.springframework.util.ReflectionUtils;
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see #setName
|
* @see #setName
|
||||||
* @see #setGroup
|
* @see #setGroup
|
||||||
* @see #setStartTime
|
* @see #setStartDelay
|
||||||
* @see #setJobName
|
|
||||||
* @see #setJobGroup
|
|
||||||
* @see #setJobDetail
|
* @see #setJobDetail
|
||||||
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setTriggers
|
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setTriggers
|
||||||
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setJobDetails
|
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setJobDetails
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -56,9 +56,7 @@ import org.springframework.util.ReflectionUtils;
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see #setName
|
* @see #setName
|
||||||
* @see #setGroup
|
* @see #setGroup
|
||||||
* @see #setStartTime
|
* @see #setStartDelay
|
||||||
* @see #setJobName
|
|
||||||
* @see #setJobGroup
|
|
||||||
* @see #setJobDetail
|
* @see #setJobDetail
|
||||||
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setTriggers
|
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setTriggers
|
||||||
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setJobDetails
|
* @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setJobDetails
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -41,7 +41,7 @@ public interface CacheAnnotationParser {
|
||||||
* @param ae the annotated method or class
|
* @param ae the annotated method or class
|
||||||
* @return CacheOperation the configured caching operation,
|
* @return CacheOperation the configured caching operation,
|
||||||
* or {@code null} if none was found
|
* or {@code null} if none was found
|
||||||
* @see AnnotationCacheOperationSource#determineCacheOperation
|
* @see AnnotationCacheOperationSource#determineCacheOperations(AnnotatedElement)
|
||||||
*/
|
*/
|
||||||
Collection<CacheOperation> parseCacheAnnotations(AnnotatedElement ae);
|
Collection<CacheOperation> parseCacheAnnotations(AnnotatedElement ae);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -30,7 +30,7 @@ import org.springframework.context.annotation.AutoProxyRegistrar;
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see EnableCaching
|
* @see EnableCaching
|
||||||
* @see ProxyCachingConfiguration
|
* @see ProxyCachingConfiguration
|
||||||
* @see AnnotationConfigUtils.CACHE_ASPECT_CONFIGURATION_CLASS_NAME
|
* @see AnnotationConfigUtils#CACHE_ASPECT_CONFIGURATION_CLASS_NAME
|
||||||
*/
|
*/
|
||||||
public class CachingConfigurationSelector extends AdviceModeImportSelector<EnableCaching> {
|
public class CachingConfigurationSelector extends AdviceModeImportSelector<EnableCaching> {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -163,7 +163,7 @@ public @interface EnableCaching {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicate how caching advice should be applied. The default is
|
* Indicate how caching advice should be applied. The default is
|
||||||
* {@link AdviceMode.PROXY}.
|
* {@link AdviceMode#PROXY}.
|
||||||
* @see AdviceMode
|
* @see AdviceMode
|
||||||
*/
|
*/
|
||||||
AdviceMode mode() default AdviceMode.PROXY;
|
AdviceMode mode() default AdviceMode.PROXY;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -115,7 +115,7 @@ public class ConcurrentMapCache implements Cache {
|
||||||
/**
|
/**
|
||||||
* Convert the given value from the internal store to a user value
|
* Convert the given value from the internal store to a user value
|
||||||
* returned from the get method (adapting <code>null</code>).
|
* returned from the get method (adapting <code>null</code>).
|
||||||
* @param userValue the store value
|
* @param storeValue the store value
|
||||||
* @return the value to return to the user
|
* @return the value to return to the user
|
||||||
*/
|
*/
|
||||||
protected Object fromStoreValue(Object storeValue) {
|
protected Object fromStoreValue(Object storeValue) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -39,8 +39,8 @@ public class EhCacheCacheManager extends AbstractCacheManager {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the backing Ehcache {@link net.sf.ehcache.CacheManager}.
|
* Returns the backing EhCache {@link net.sf.ehcache.CacheManager}.
|
||||||
* @return
|
* @return the backing EhCache {@link net.sf.ehcache.CacheManager}.
|
||||||
*/
|
*/
|
||||||
public net.sf.ehcache.CacheManager getCacheManager() {
|
public net.sf.ehcache.CacheManager getCacheManager() {
|
||||||
return cacheManager;
|
return cacheManager;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -44,7 +44,6 @@ public class BeanFactoryCacheOperationSourceAdvisor extends AbstractBeanFactoryP
|
||||||
* Set the cache operation attribute source which is used to find cache
|
* Set the cache operation attribute source which is used to find cache
|
||||||
* attributes. This should usually be identical to the source reference
|
* attributes. This should usually be identical to the source reference
|
||||||
* set on the cache interceptor itself.
|
* set on the cache interceptor itself.
|
||||||
* @see CacheInterceptor#setCacheAttributeSource
|
|
||||||
*/
|
*/
|
||||||
public void setCacheOperationSource(CacheOperationSource cacheOperationSource) {
|
public void setCacheOperationSource(CacheOperationSource cacheOperationSource) {
|
||||||
this.cacheOperationSource = cacheOperationSource;
|
this.cacheOperationSource = cacheOperationSource;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010-2011 the original author or authors.
|
* Copyright 2010-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -24,7 +24,7 @@ import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||||
* Proxy factory bean for simplified declarative caching handling.
|
* Proxy factory bean for simplified declarative caching handling.
|
||||||
* This is a convenient alternative to a standard AOP
|
* This is a convenient alternative to a standard AOP
|
||||||
* {@link org.springframework.aop.framework.ProxyFactoryBean}
|
* {@link org.springframework.aop.framework.ProxyFactoryBean}
|
||||||
* with a separate {@link CachingInterceptor} definition.
|
* with a separate {@link CacheInterceptor} definition.
|
||||||
*
|
*
|
||||||
* <p>This class is designed to facilitate declarative cache demarcation: namely, wrapping
|
* <p>This class is designed to facilitate declarative cache demarcation: namely, wrapping
|
||||||
* a singleton target object with a caching proxy, proxying all the interfaces that the
|
* a singleton target object with a caching proxy, proxying all the interfaces that the
|
||||||
|
|
@ -36,7 +36,7 @@ import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||||
*
|
*
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
* @see org.springframework.aop.framework.ProxyFactoryBean
|
* @see org.springframework.aop.framework.ProxyFactoryBean
|
||||||
* @see CachingInterceptor
|
* @see CacheInterceptor
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class CacheProxyFactoryBean extends AbstractSingletonProxyFactoryBean {
|
public class CacheProxyFactoryBean extends AbstractSingletonProxyFactoryBean {
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ public class NameMatchCacheOperationSource implements CacheOperationSource, Seri
|
||||||
* (e.g. "myMethod") and CacheOperation instances
|
* (e.g. "myMethod") and CacheOperation instances
|
||||||
* (or Strings to be converted to CacheOperation instances).
|
* (or Strings to be converted to CacheOperation instances).
|
||||||
* @see CacheOperation
|
* @see CacheOperation
|
||||||
* @see CacheOperationEditor
|
|
||||||
*/
|
*/
|
||||||
public void setNameMap(Map<String, Collection<CacheOperation>> nameMap) {
|
public void setNameMap(Map<String, Collection<CacheOperation>> nameMap) {
|
||||||
for (Map.Entry<String, Collection<CacheOperation>> entry : nameMap.entrySet()) {
|
for (Map.Entry<String, Collection<CacheOperation>> entry : nameMap.entrySet()) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -28,7 +28,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that a class declares one or more @{@link Bean} methods and may be processed
|
* Indicates that a class declares one or more {@link Bean @Bean} methods and may be processed
|
||||||
* by the Spring container to generate bean definitions and service requests for those
|
* by the Spring container to generate bean definitions and service requests for those
|
||||||
* beans at runtime, for example:
|
* beans at runtime, for example:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
|
|
@ -76,14 +76,14 @@ import org.springframework.stereotype.Component;
|
||||||
* post processors that facilitate handling {@code @Configuration} classes.
|
* post processors that facilitate handling {@code @Configuration} classes.
|
||||||
*
|
*
|
||||||
* <h3>Via component scanning</h3>
|
* <h3>Via component scanning</h3>
|
||||||
* <p>{@code @Configuration} is meta-annotated with @{@link Component}, therefore
|
* <p>{@code @Configuration} is meta-annotated with {@link Component @Component}, therefore
|
||||||
* {@code @Configuration} classes are candidates for component scanning (typically using
|
* {@code @Configuration} classes are candidates for component scanning (typically using
|
||||||
* Spring XML's {@code <context:component-scan/>} element) and therefore may also take
|
* Spring XML's {@code <context:component-scan/>} element) and therefore may also take
|
||||||
* advantage of @{@link Autowired}/@{@link Inject} at the field and method level (but not
|
* advantage of {@link Autowired @Autowired}/{@link javax.inject.Inject @Inject}
|
||||||
* at the constructor level).
|
* at the field and method level (but not at the constructor level).
|
||||||
* <p>{@code @Configuration} classes may not only be bootstrapped using
|
* <p>{@code @Configuration} classes may not only be bootstrapped using
|
||||||
* component scanning, but may also themselves <em>configure</em> component scanning using
|
* component scanning, but may also themselves <em>configure</em> component scanning using
|
||||||
* the @{@link ComponentScan} annotation:
|
* the {@link ComponentScan @ComponentScan} annotation:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* @Configuration
|
* @Configuration
|
||||||
* @ComponentScan("com.acme.app.services")
|
* @ComponentScan("com.acme.app.services")
|
||||||
|
|
@ -91,8 +91,8 @@ import org.springframework.stereotype.Component;
|
||||||
* // various @Bean definitions ...
|
* // various @Bean definitions ...
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* See @{@link ComponentScan} Javadoc for details.
|
* See {@link ComponentScan @ComponentScan} Javadoc for details.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* <h2>Working with externalized values</h2>
|
* <h2>Working with externalized values</h2>
|
||||||
* <h3>Using the {@code Environment} API</h3>
|
* <h3>Using the {@code Environment} API</h3>
|
||||||
|
|
@ -115,7 +115,8 @@ import org.springframework.stereotype.Component;
|
||||||
*
|
*
|
||||||
* Properties resolved through the {@code Environment} reside in one or more "property
|
* Properties resolved through the {@code Environment} reside in one or more "property
|
||||||
* source" objects, and {@code @Configuration} classes may contribute property sources to
|
* source" objects, and {@code @Configuration} classes may contribute property sources to
|
||||||
* the {@code Environment} object using the @{@link PropertySources} annotation:
|
* the {@code Environment} object using
|
||||||
|
* the {@link org.springframework.core.env.PropertySources @PropertySources} annotation:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* @Configuration
|
* @Configuration
|
||||||
* @PropertySource("classpath:/com/acme/app.properties")
|
* @PropertySource("classpath:/com/acme/app.properties")
|
||||||
|
|
@ -129,11 +130,11 @@ import org.springframework.stereotype.Component;
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* See {@link org.springframework.core.env.Environment Environment}
|
* See {@link org.springframework.core.env.Environment Environment}
|
||||||
* and @{@link PropertySource} Javadoc for further details.
|
* and {@link PropertySource @PropertySource} Javadoc for further details.
|
||||||
*
|
*
|
||||||
* <h3>Using the {@code @Value} annotation</h3>
|
* <h3>Using the {@code @Value} annotation</h3>
|
||||||
* Externalized values may be 'wired into' {@code @Configuration} classes using
|
* Externalized values may be 'wired into' {@code @Configuration} classes using
|
||||||
* the @{@link Value} annotation:
|
* the {@link Value @Value} annotation:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* @Configuration
|
* @Configuration
|
||||||
* @PropertySource("classpath:/com/acme/app.properties")
|
* @PropertySource("classpath:/com/acme/app.properties")
|
||||||
|
|
@ -151,13 +152,13 @@ import org.springframework.stereotype.Component;
|
||||||
* PropertySourcesPlaceholderConfigurer}, usually enabled via XML with
|
* PropertySourcesPlaceholderConfigurer}, usually enabled via XML with
|
||||||
* {@code <context:property-placeholder/>}. See the section below on composing
|
* {@code <context:property-placeholder/>}. See the section below on composing
|
||||||
* {@code @Configuration} classes with Spring XML using {@code @ImportResource},
|
* {@code @Configuration} classes with Spring XML using {@code @ImportResource},
|
||||||
* see @{@link Value} Javadoc, and see @{@link Bean} Javadoc for details on working with
|
* see {@link Value @Value} Javadoc, and see {@link Bean @Bean} Javadoc for details on working with
|
||||||
* {@code BeanFactoryPostProcessor} types such as
|
* {@code BeanFactoryPostProcessor} types such as
|
||||||
* {@code PropertySourcesPlaceholderConfigurer}.
|
* {@code PropertySourcesPlaceholderConfigurer}.
|
||||||
*
|
*
|
||||||
* <h2>Composing {@code @Configuration} classes</h2>
|
* <h2>Composing {@code @Configuration} classes</h2>
|
||||||
* <h3>With the {@code @Import} annotation</h3>
|
* <h3>With the {@code @Import} annotation</h3>
|
||||||
* <p>{@code @Configuration} classes may be composed using the @{@link Import} annotation,
|
* <p>{@code @Configuration} classes may be composed using the {@link Import @Import} annotation,
|
||||||
* not unlike the way that {@code <import>} works in Spring XML. Because
|
* not unlike the way that {@code <import>} works in Spring XML. Because
|
||||||
* {@code @Configuration} objects are managed as Spring beans within the container,
|
* {@code @Configuration} objects are managed as Spring beans within the container,
|
||||||
* imported configurations may be injected using {@code @Autowired} or {@code @Inject}:
|
* imported configurations may be injected using {@code @Autowired} or {@code @Inject}:
|
||||||
|
|
@ -189,7 +190,7 @@ import org.springframework.stereotype.Component;
|
||||||
* new AnnotationConfigApplicationContext(AppConfig.class);</pre>
|
* new AnnotationConfigApplicationContext(AppConfig.class);</pre>
|
||||||
*
|
*
|
||||||
* <h3>With the {@code @Profile} annotation</h3>
|
* <h3>With the {@code @Profile} annotation</h3>
|
||||||
* {@code @Configuration} classes may be marked with the @{@link Profile} annotation to
|
* {@code @Configuration} classes may be marked with the {@link Profile @Profile} annotation to
|
||||||
* indicate they should be processed only if a given profile or profiles are
|
* indicate they should be processed only if a given profile or profiles are
|
||||||
* <em>active</em>:
|
* <em>active</em>:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
|
|
@ -211,14 +212,14 @@ import org.springframework.stereotype.Component;
|
||||||
* }
|
* }
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* See @{@link Profile} and {@link org.springframework.core.env.Environment Environment}
|
* See {@link Profile @Profile} and {@link org.springframework.core.env.Environment Environment}
|
||||||
* Javadoc for further details.
|
* Javadoc for further details.
|
||||||
*
|
*
|
||||||
* <h3>With Spring XML using the {@code @ImportResource} annotation</h3>
|
* <h3>With Spring XML using the {@code @ImportResource} annotation</h3>
|
||||||
* As mentioned above, {@code @Configuration} classes may be declared as regular Spring
|
* As mentioned above, {@code @Configuration} classes may be declared as regular Spring
|
||||||
* {@code <bean>} definitions within Spring XML files. It is also possible to
|
* {@code <bean>} definitions within Spring XML files. It is also possible to
|
||||||
* import Spring XML configuration files into {@code @Configuration} classes using
|
* import Spring XML configuration files into {@code @Configuration} classes using
|
||||||
* the @{@link ImportResource} annotation. Bean definitions imported from XML can be
|
* the {@link ImportResource @ImportResource} annotation. Bean definitions imported from XML can be
|
||||||
* injected using {@code @Autowired} or {@code @Import}:
|
* injected using {@code @Autowired} or {@code @Import}:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* @Configuration
|
* @Configuration
|
||||||
|
|
@ -267,7 +268,7 @@ import org.springframework.stereotype.Component;
|
||||||
* <h2>Configuring lazy initialization</h2>
|
* <h2>Configuring lazy initialization</h2>
|
||||||
* <p>By default, {@code @Bean} methods will be <em>eagerly instantiated</em> at container
|
* <p>By default, {@code @Bean} methods will be <em>eagerly instantiated</em> at container
|
||||||
* bootstrap time. To avoid this, {@code @Configuration} may be used in conjunction with
|
* bootstrap time. To avoid this, {@code @Configuration} may be used in conjunction with
|
||||||
* the @{@link Lazy} annotation to indicate that all {@code @Bean} methods declared within
|
* the {@link Lazy @Lazy} annotation to indicate that all {@code @Bean} methods declared within
|
||||||
* the class are by default lazily initialized. Note that {@code @Lazy} may be used on
|
* the class are by default lazily initialized. Note that {@code @Lazy} may be used on
|
||||||
* individual {@code @Bean} methods as well.
|
* individual {@code @Bean} methods as well.
|
||||||
*
|
*
|
||||||
|
|
@ -291,7 +292,7 @@ import org.springframework.stereotype.Component;
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* See TestContext framework reference documentation for details.
|
* See TestContext framework reference documentation for details.
|
||||||
*
|
*
|
||||||
* <h2>Enabling built-in Spring features using {@code @Enable} annotations</h2>
|
* <h2>Enabling built-in Spring features using {@code @Enable} annotations</h2>
|
||||||
* Spring features such as asynchronous method execution, scheduled task execution,
|
* Spring features such as asynchronous method execution, scheduled task execution,
|
||||||
* annotation driven transaction management, and even Spring MVC can be enabled and
|
* annotation driven transaction management, and even Spring MVC can be enabled and
|
||||||
|
|
@ -309,7 +310,7 @@ import org.springframework.stereotype.Component;
|
||||||
* <li>@Configuration classes must be non-final
|
* <li>@Configuration classes must be non-final
|
||||||
* <li>@Configuration classes must be non-local (may not be declared within a method)
|
* <li>@Configuration classes must be non-local (may not be declared within a method)
|
||||||
* <li>@Configuration classes must have a default/no-arg constructor and may not
|
* <li>@Configuration classes must have a default/no-arg constructor and may not
|
||||||
* use @{@link Autowired} constructor parameters. Any nested configuration classes
|
* use {@link Autowired @Autowired} constructor parameters. Any nested configuration classes
|
||||||
* must be {@code static}
|
* must be {@code static}
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -64,13 +64,13 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
|
||||||
* TomcatInstrumentableClassLoader}).
|
* TomcatInstrumentableClassLoader}).
|
||||||
*
|
*
|
||||||
* <p>To customize the weaver used, the {@code @Configuration} class annotated with
|
* <p>To customize the weaver used, the {@code @Configuration} class annotated with
|
||||||
* {@code @EnableLoadTimeWeaving} may also implement the {@link LoadTimeWeaverConfigurer}
|
* {@code @EnableLoadTimeWeaving} may also implement the {@link LoadTimeWeavingConfigurer}
|
||||||
* interface and return a custom {@code LoadTimeWeaver} instance through the
|
* interface and return a custom {@code LoadTimeWeaver} instance through the
|
||||||
* {@code #getLoadTimeWeaver} method:
|
* {@code #getLoadTimeWeaver} method:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* @Configuration
|
* @Configuration
|
||||||
* @EnableLoadTimeWeaving
|
* @EnableLoadTimeWeaving
|
||||||
* public class AppConfig implements LoadTimeWeaverConfigurer {
|
* public class AppConfig implements LoadTimeWeavingConfigurer {
|
||||||
* @Override
|
* @Override
|
||||||
* public LoadTimeWeaver getLoadTimeWeaver() {
|
* public LoadTimeWeaver getLoadTimeWeaver() {
|
||||||
* MyLoadTimeWeaver ltw = new MyLoadTimeWeaver();
|
* MyLoadTimeWeaver ltw = new MyLoadTimeWeaver();
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ import org.springframework.core.type.filter.AssignableTypeFilter;
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
* @see ComponentScan
|
* @see ComponentScan
|
||||||
* @see ComponentScan.IncludeFilter
|
* @see ComponentScan#includeFilters()
|
||||||
* @see ComponentScan.ExcludeFilter
|
* @see ComponentScan#excludeFilters()
|
||||||
* @see org.springframework.core.type.filter.TypeFilter
|
* @see org.springframework.core.type.filter.TypeFilter
|
||||||
*/
|
*/
|
||||||
public enum FilterType {
|
public enum FilterType {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -23,23 +23,23 @@ import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates one or more @{@link Configuration} classes to import.
|
* Indicates one or more {@link Configuration @Configuration} classes to import.
|
||||||
*
|
*
|
||||||
* <p>Provides functionality equivalent to the {@code <import/>} element in Spring XML.
|
* <p>Provides functionality equivalent to the {@code <import/>} element in Spring XML.
|
||||||
* Only supported for classes annotated with {@code @Configuration} or declaring at least
|
* Only supported for classes annotated with {@code @Configuration} or declaring at least
|
||||||
* one {@link @Bean} method, as well as {@link ImportSelector} and
|
* one {@link Bean @Bean} method, as well as {@link ImportSelector} and
|
||||||
* {@link ImportBeanDefinitionRegistrar} implementations.
|
* {@link ImportBeanDefinitionRegistrar} implementations.
|
||||||
*
|
*
|
||||||
* <p>@{@code Bean} definitions declared in imported {@code @Configuration} classes
|
* <p>{@code @Bean} definitions declared in imported {@code @Configuration} classes
|
||||||
* should be accessed by using @{@link Autowired} injection. Either the bean itself can
|
* should be accessed by using {@link org.springframework.beans.factory.annotation.Autowired @Autowired}
|
||||||
* be autowired, or the configuration class instance declaring the bean can be autowired.
|
* injection. Either the bean itself can be autowired, or the configuration class instance
|
||||||
* The latter approach allows for explicit, IDE-friendly navigation between
|
* declaring the bean can be autowired. The latter approach allows for explicit,
|
||||||
* {@code @Configuration} class methods.
|
* IDE-friendly navigation between {@code @Configuration} class methods.
|
||||||
*
|
*
|
||||||
* <p>May be declared at the class level or as a meta-annotation.
|
* <p>May be declared at the class level or as a meta-annotation.
|
||||||
*
|
*
|
||||||
* <p>If XML or other non-{@code @Configuration} bean definition resources need to be
|
* <p>If XML or other non-{@code @Configuration} bean definition resources need to be
|
||||||
* imported, use @{@link ImportResource}
|
* imported, use {@link ImportResource @ImportResource}
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -19,12 +19,14 @@ package org.springframework.context.annotation;
|
||||||
import org.springframework.instrument.classloading.LoadTimeWeaver;
|
import org.springframework.instrument.classloading.LoadTimeWeaver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to be implemented by @{@link org.springframework.context.annotation.Configuration
|
* Interface to be implemented by
|
||||||
* Configuration} classes annotated with @{@link EnableLoadTimeWeaving} that wish to
|
* {@link org.springframework.context.annotation.Configuration @Configuration}
|
||||||
|
* classes annotated with {@link EnableLoadTimeWeaving @EnableLoadTimeWeaving} that wish to
|
||||||
* customize the {@link LoadTimeWeaver} instance to be used.
|
* customize the {@link LoadTimeWeaver} instance to be used.
|
||||||
*
|
*
|
||||||
* <p>See @{@link EnableAsync} for usage examples and information on how a default
|
* <p>See {@link org.springframework.scheduling.annotation.EnableAsync @EnableAsync}
|
||||||
* {@code LoadTimeWeaver} is selected when this interface is not used.
|
* for usage examples and information on how a default {@code LoadTimeWeaver}
|
||||||
|
* is selected when this interface is not used.
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
|
|
|
||||||
|
|
@ -506,7 +506,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||||
/**
|
/**
|
||||||
* <p>Replace any stub property sources with actual instances.
|
* <p>Replace any stub property sources with actual instances.
|
||||||
* @see org.springframework.core.env.PropertySource.StubPropertySource
|
* @see org.springframework.core.env.PropertySource.StubPropertySource
|
||||||
* @see org.springframework.web.context.support.WebApplicationContextUtils#initSerlvetPropertySources
|
* @see org.springframework.web.context.support.WebApplicationContextUtils#initServletPropertySources
|
||||||
*/
|
*/
|
||||||
protected void initPropertySources() {
|
protected void initPropertySources() {
|
||||||
// For subclasses: do nothing by default.
|
// For subclasses: do nothing by default.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -108,7 +108,7 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS
|
||||||
* <p>Processing occurs by replacing ${...} placeholders in bean definitions by resolving each
|
* <p>Processing occurs by replacing ${...} placeholders in bean definitions by resolving each
|
||||||
* against this configurer's set of {@link PropertySources}, which includes:
|
* against this configurer's set of {@link PropertySources}, which includes:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>all {@linkplain Environment#getPropertySources environment property sources}, if an
|
* <li>all {@linkplain org.springframework.core.env.ConfigurableEnvironment#getPropertySources environment property sources}, if an
|
||||||
* {@code Environment} {@linkplain #setEnvironment is present}
|
* {@code Environment} {@linkplain #setEnvironment is present}
|
||||||
* <li>{@linkplain #mergeProperties merged local properties}, if {@linkplain #setLocation any}
|
* <li>{@linkplain #mergeProperties merged local properties}, if {@linkplain #setLocation any}
|
||||||
* {@linkplain #setLocations have} {@linkplain #setProperties been}
|
* {@linkplain #setLocations have} {@linkplain #setProperties been}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -41,7 +41,7 @@ import org.springframework.format.Printer;
|
||||||
* @see #setTimeStyle
|
* @see #setTimeStyle
|
||||||
* @see #setDateTimeStyle
|
* @see #setDateTimeStyle
|
||||||
* @see #setUseIsoFormat
|
* @see #setUseIsoFormat
|
||||||
* @see #installJodaTimeFormatting
|
* @see FormatterRegistrar#registerFormatters
|
||||||
*/
|
*/
|
||||||
public class JodaTimeFormatterRegistrar implements FormatterRegistrar {
|
public class JodaTimeFormatterRegistrar implements FormatterRegistrar {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,9 @@ import org.springframework.util.Assert;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link LoadTimeWeaver} implementation for GlassFish's {@link InstrumentableClassLoader}.
|
* {@link LoadTimeWeaver} implementation for GlassFish's
|
||||||
*
|
* {@link org.glassfish.api.deployment.InstrumentableClassLoader InstrumentableClassLoader}.
|
||||||
|
*
|
||||||
* <p>As of Spring 3.0, GlassFish V3 is supported as well.
|
* <p>As of Spring 3.0, GlassFish V3 is supported as well.
|
||||||
*
|
*
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
|
|
@ -49,7 +50,8 @@ public class GlassFishLoadTimeWeaver implements LoadTimeWeaver {
|
||||||
* Creates a new instance of the <code>GlassFishLoadTimeWeaver</code> class.
|
* Creates a new instance of the <code>GlassFishLoadTimeWeaver</code> class.
|
||||||
* @param classLoader the specific {@link ClassLoader} to use; must not be <code>null</code>
|
* @param classLoader the specific {@link ClassLoader} to use; must not be <code>null</code>
|
||||||
* @throws IllegalArgumentException if the supplied <code>classLoader</code> is <code>null</code>;
|
* @throws IllegalArgumentException if the supplied <code>classLoader</code> is <code>null</code>;
|
||||||
* or if the supplied <code>classLoader</code> is not an {@link InstrumentableClassLoader}
|
* or if the supplied <code>classLoader</code> is not an
|
||||||
|
* {@link org.glassfish.api.deployment.InstrumentableClassLoader InstrumentableClassLoader}
|
||||||
*/
|
*/
|
||||||
public GlassFishLoadTimeWeaver(ClassLoader classLoader) {
|
public GlassFishLoadTimeWeaver(ClassLoader classLoader) {
|
||||||
Assert.notNull(classLoader, "ClassLoader must not be null");
|
Assert.notNull(classLoader, "ClassLoader must not be null");
|
||||||
|
|
|
||||||
|
|
@ -526,7 +526,7 @@ public class MBeanClientInterceptor
|
||||||
* Convert the given result object (from attribute access or operation invocation)
|
* Convert the given result object (from attribute access or operation invocation)
|
||||||
* to the specified target class for returning from the proxy method.
|
* to the specified target class for returning from the proxy method.
|
||||||
* @param result the result object as returned by the <code>MBeanServer</code>
|
* @param result the result object as returned by the <code>MBeanServer</code>
|
||||||
* @param targetClass the result type of the proxy method that's been invoked
|
* @param parameter the method parameter of the proxy method that's been invoked
|
||||||
* @return the converted result object, or the passed-in object if no conversion
|
* @return the converted result object, or the passed-in object if no conversion
|
||||||
* is necessary
|
* is necessary
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public abstract class AbstractMBeanInfoAssembler implements MBeanInfoAssembler {
|
||||||
* and the plain bean class else.
|
* and the plain bean class else.
|
||||||
* @param managedBean the bean instance (might be an AOP proxy)
|
* @param managedBean the bean instance (might be an AOP proxy)
|
||||||
* @return the bean class to expose
|
* @return the bean class to expose
|
||||||
* @see org.springframework.aop.framework.AopProxyUtils#getTargetClass
|
* @see org.springframework.aop.support.AopUtils#getTargetClass(Object)
|
||||||
*/
|
*/
|
||||||
protected Class getTargetClass(Object managedBean) {
|
protected Class getTargetClass(Object managedBean) {
|
||||||
return AopUtils.getTargetClass(managedBean);
|
return AopUtils.getTargetClass(managedBean);
|
||||||
|
|
@ -100,7 +100,7 @@ public abstract class AbstractMBeanInfoAssembler implements MBeanInfoAssembler {
|
||||||
* (for example, checked for annotations).
|
* (for example, checked for annotations).
|
||||||
* @param managedBean the bean instance (might be an AOP proxy)
|
* @param managedBean the bean instance (might be an AOP proxy)
|
||||||
* @return the bean class to expose
|
* @return the bean class to expose
|
||||||
* @see JmxUtils#getClassToExpose(Object)
|
* @see JmxUtils#getClassToExpose(Object)
|
||||||
*/
|
*/
|
||||||
protected Class<?> getClassToExpose(Object managedBean) {
|
protected Class<?> getClassToExpose(Object managedBean) {
|
||||||
return JmxUtils.getClassToExpose(managedBean);
|
return JmxUtils.getClassToExpose(managedBean);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ import org.springframework.util.Assert;
|
||||||
*
|
*
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
* @see PersistenceExceptionTranslationAdvisor
|
* @see org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor
|
||||||
* @see org.springframework.stereotype.Repository
|
* @see org.springframework.stereotype.Repository
|
||||||
* @see org.springframework.dao.DataAccessException
|
* @see org.springframework.dao.DataAccessException
|
||||||
* @see org.springframework.dao.support.PersistenceExceptionTranslator
|
* @see org.springframework.dao.support.PersistenceExceptionTranslator
|
||||||
|
|
@ -126,8 +126,8 @@ public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate a pointcut for the given target class, if any.
|
* Calculate a pointcut for the given async annotation types, if any.
|
||||||
* @param targetClass the class to introspect
|
* @param asyncAnnotationTypes the async annotation types to introspect
|
||||||
* @return the applicable Pointcut object, or <code>null</code> if none
|
* @return the applicable Pointcut object, or <code>null</code> if none
|
||||||
*/
|
*/
|
||||||
protected Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes) {
|
protected Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -76,7 +76,7 @@ public class MethodValidationInterceptor implements MethodInterceptor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new MethodValidationInterceptor using the given JSR-303 Validator.
|
* Create a new MethodValidationInterceptor using the given JSR-303 Validator.
|
||||||
* @param validatorFactory the JSR-303 Validator to use
|
* @param validator the JSR-303 Validator to use
|
||||||
*/
|
*/
|
||||||
public MethodValidationInterceptor(Validator validator) {
|
public MethodValidationInterceptor(Validator validator) {
|
||||||
this.validator = validator.unwrap(MethodValidator.class);
|
this.validator = validator.unwrap(MethodValidator.class);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ package org.springframework.core.convert;
|
||||||
* Thrown when a suitable converter could not be found in a conversion service.
|
* Thrown when a suitable converter could not be found in a conversion service.
|
||||||
*
|
*
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public final class ConverterNotFoundException extends ConversionException {
|
public final class ConverterNotFoundException extends ConversionException {
|
||||||
|
|
@ -34,7 +34,6 @@ public final class ConverterNotFoundException extends ConversionException {
|
||||||
* Creates a new conversion executor not found exception.
|
* Creates a new conversion executor not found exception.
|
||||||
* @param sourceType the source type requested to convert from
|
* @param sourceType the source type requested to convert from
|
||||||
* @param targetType the target type requested to convert to
|
* @param targetType the target type requested to convert to
|
||||||
* @param message a descriptive message
|
|
||||||
*/
|
*/
|
||||||
public ConverterNotFoundException(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
public ConverterNotFoundException(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||||
super("No converter found capable of converting from type " + sourceType + " to type " + targetType);
|
super("No converter found capable of converting from type " + sourceType + " to type " + targetType);
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ public class TypeDescriptor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new type descriptor from a {@link MethodParameter}.
|
* Create a new type descriptor from a {@link MethodParameter}.
|
||||||
* Use this constructor when a source or target conversion point is a constructor parameter, method parameter, or method return value.
|
* Use this constructor when a source or target conversion point is a constructor parameter, method parameter, or method return value.
|
||||||
* @param methodParameter the method parameter
|
* @param methodParameter the method parameter
|
||||||
*/
|
*/
|
||||||
public TypeDescriptor(MethodParameter methodParameter) {
|
public TypeDescriptor(MethodParameter methodParameter) {
|
||||||
|
|
@ -204,7 +204,7 @@ public class TypeDescriptor {
|
||||||
* Create a new type descriptor for an object.
|
* Create a new type descriptor for an object.
|
||||||
* Use this factory method to introspect a source object before asking the conversion system to convert it to some another type.
|
* Use this factory method to introspect a source object before asking the conversion system to convert it to some another type.
|
||||||
* If the provided object is null, returns null, else calls {@link #valueOf(Class)} to build a TypeDescriptor from the object's class.
|
* If the provided object is null, returns null, else calls {@link #valueOf(Class)} to build a TypeDescriptor from the object's class.
|
||||||
* @param object the source object
|
* @param source the source object
|
||||||
* @return the type descriptor
|
* @return the type descriptor
|
||||||
*/
|
*/
|
||||||
public static TypeDescriptor forObject(Object source) {
|
public static TypeDescriptor forObject(Object source) {
|
||||||
|
|
@ -287,7 +287,7 @@ public class TypeDescriptor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if an object of this type descriptor can be assigned to the location described by the given type descriptor.
|
* Returns true if an object of this type descriptor can be assigned to the location described by the given type descriptor.
|
||||||
* For example, valueOf(String.class).isAssignableTo(valueOf(CharSequence.class)) returns true because a String value can be assigned to a CharSequence variable.
|
* For example, valueOf(String.class).isAssignableTo(valueOf(CharSequence.class)) returns true because a String value can be assigned to a CharSequence variable.
|
||||||
* On the other hand, valueOf(Number.class).isAssignableTo(valueOf(Integer.class)) returns false because, while all Integers are Numbers, not all Numbers are Integers.
|
* On the other hand, valueOf(Number.class).isAssignableTo(valueOf(Integer.class)) returns false because, while all Integers are Numbers, not all Numbers are Integers.
|
||||||
* <p>
|
* <p>
|
||||||
* For arrays, collections, and maps, element and key/value types are checked if declared.
|
* For arrays, collections, and maps, element and key/value types are checked if declared.
|
||||||
|
|
@ -348,7 +348,7 @@ public class TypeDescriptor {
|
||||||
* Narrows the {@link #getElementTypeDescriptor() elementType} property to the class of the provided collection or array element.
|
* Narrows the {@link #getElementTypeDescriptor() elementType} property to the class of the provided collection or array element.
|
||||||
* For example, if this describes a java.util.List<java.lang.Number< and the element argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer.
|
* For example, if this describes a java.util.List<java.lang.Number< and the element argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer.
|
||||||
* If this describes a java.util.List<?> and the element argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well.
|
* If this describes a java.util.List<?> and the element argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well.
|
||||||
* Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned.
|
* Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned.
|
||||||
* @param element the collection or array element
|
* @param element the collection or array element
|
||||||
* @return a element type descriptor, narrowed to the type of the provided element
|
* @return a element type descriptor, narrowed to the type of the provided element
|
||||||
* @throws IllegalStateException if this type is not a java.util.Collection or Array type
|
* @throws IllegalStateException if this type is not a java.util.Collection or Array type
|
||||||
|
|
@ -383,7 +383,7 @@ public class TypeDescriptor {
|
||||||
* Narrows the {@link #getMapKeyTypeDescriptor() mapKeyType} property to the class of the provided map key.
|
* Narrows the {@link #getMapKeyTypeDescriptor() mapKeyType} property to the class of the provided map key.
|
||||||
* For example, if this describes a java.util.Map<java.lang.Number, java.lang.String< and the key argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer.
|
* For example, if this describes a java.util.Map<java.lang.Number, java.lang.String< and the key argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer.
|
||||||
* If this describes a java.util.Map<?, ?> and the key argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well.
|
* If this describes a java.util.Map<?, ?> and the key argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well.
|
||||||
* Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned.
|
* Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned.
|
||||||
* @param mapKey the map key
|
* @param mapKey the map key
|
||||||
* @return the map key type descriptor
|
* @return the map key type descriptor
|
||||||
* @throws IllegalStateException if this type is not a java.util.Map.
|
* @throws IllegalStateException if this type is not a java.util.Map.
|
||||||
|
|
@ -409,10 +409,10 @@ public class TypeDescriptor {
|
||||||
* Narrows the {@link #getMapValueTypeDescriptor() mapValueType} property to the class of the provided map value.
|
* Narrows the {@link #getMapValueTypeDescriptor() mapValueType} property to the class of the provided map value.
|
||||||
* For example, if this describes a java.util.Map<java.lang.String, java.lang.Number< and the value argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer.
|
* For example, if this describes a java.util.Map<java.lang.String, java.lang.Number< and the value argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer.
|
||||||
* If this describes a java.util.Map<?, ?> and the value argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well.
|
* If this describes a java.util.Map<?, ?> and the value argument is a java.lang.Integer, the returned TypeDescriptor will be java.lang.Integer as well.
|
||||||
* Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned.
|
* Annotation and nested type context will be preserved in the narrowed TypeDescriptor that is returned.
|
||||||
* @param mapValue the map value
|
* @param mapValue the map value
|
||||||
* @return the map value type descriptor
|
* @return the map value type descriptor
|
||||||
* @throws IllegalStateException if this type is not a java.util.Map.
|
* @throws IllegalStateException if this type is not a java.util.Map.
|
||||||
*/
|
*/
|
||||||
public TypeDescriptor getMapValueTypeDescriptor(Object mapValue) {
|
public TypeDescriptor getMapValueTypeDescriptor(Object mapValue) {
|
||||||
return narrow(mapValue, getMapValueTypeDescriptor());
|
return narrow(mapValue, getMapValueTypeDescriptor());
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,9 @@ import static org.springframework.util.StringUtils.*;
|
||||||
*
|
*
|
||||||
* <p>Concrete subclasses differ primarily on which {@link PropertySource} objects they
|
* <p>Concrete subclasses differ primarily on which {@link PropertySource} objects they
|
||||||
* add by default. {@code AbstractEnvironment} adds none. Subclasses should contribute
|
* add by default. {@code AbstractEnvironment} adds none. Subclasses should contribute
|
||||||
* property sources through the protected {@link #customizePropertySources()} hook, while
|
* property sources through the protected {@link #customizePropertySources(MutablePropertySources)}
|
||||||
* clients should customize using {@link ConfigurableEnvironment#getPropertySources()} and
|
* hook, while clients should customize using {@link ConfigurableEnvironment#getPropertySources()}
|
||||||
* working against the {@link MutablePropertySources} API. See
|
* and working against the {@link MutablePropertySources} API. See
|
||||||
* {@link ConfigurableEnvironment} Javadoc for usage examples.
|
* {@link ConfigurableEnvironment} Javadoc for usage examples.
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -56,7 +56,7 @@ public interface PropertyResolver {
|
||||||
* Return the property value associated with the given key, or {@code null}
|
* Return the property value associated with the given key, or {@code null}
|
||||||
* if the key cannot be resolved.
|
* if the key cannot be resolved.
|
||||||
* @param key the property name to resolve
|
* @param key the property name to resolve
|
||||||
* @param T the expected type of the property value
|
* @param targetType the expected type of the property value
|
||||||
* @see #getRequiredProperty(String, Class)
|
* @see #getRequiredProperty(String, Class)
|
||||||
*/
|
*/
|
||||||
<T> T getProperty(String key, Class<T> targetType);
|
<T> T getProperty(String key, Class<T> targetType);
|
||||||
|
|
@ -65,11 +65,11 @@ public interface PropertyResolver {
|
||||||
* Return the property value associated with the given key, or
|
* Return the property value associated with the given key, or
|
||||||
* {@code defaultValue} if the key cannot be resolved.
|
* {@code defaultValue} if the key cannot be resolved.
|
||||||
* @param key the property name to resolve
|
* @param key the property name to resolve
|
||||||
* @param T the expected type of the property value
|
* @param targetType the expected type of the property value
|
||||||
* @param defaultValue the default value to return if no value is found
|
* @param defaultValue the default value to return if no value is found
|
||||||
* @see #getRequiredProperty(String, Class)
|
* @see #getRequiredProperty(String, Class)
|
||||||
*/
|
*/
|
||||||
<T> T getProperty(String string, Class<T> targetType, T defaultValue);
|
<T> T getProperty(String key, Class<T> targetType, T defaultValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the property value associated with the given key to a {@code Class}
|
* Convert the property value associated with the given key to a {@code Class}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import org.springframework.core.serializer.Serializer;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@Link Converter} that delegates to a {@link org.springframework.core.serializer.Serializer}
|
* A {@link Converter} that delegates to a {@link org.springframework.core.serializer.Serializer}
|
||||||
* to convert an object to a byte array.
|
* to convert an object to a byte array.
|
||||||
*
|
*
|
||||||
* @author Gary Russell
|
* @author Gary Russell
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public class ExecutorServiceAdapter extends AbstractExecutorService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new ExecutorServiceAdapter, using the given target executor.
|
* Create a new ExecutorServiceAdapter, using the given target executor.
|
||||||
* @param concurrentExecutor the target executor to delegate to
|
* @param taskExecutor the target executor to delegate to
|
||||||
*/
|
*/
|
||||||
public ExecutorServiceAdapter(TaskExecutor taskExecutor) {
|
public ExecutorServiceAdapter(TaskExecutor taskExecutor) {
|
||||||
Assert.notNull(taskExecutor, "TaskExecutor must not be null");
|
Assert.notNull(taskExecutor, "TaskExecutor must not be null");
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public interface SpelNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if this expression node will support a setValue() call.
|
* Determine if this expression node will support a setValue() call.
|
||||||
*
|
*
|
||||||
* @param expressionState the current expression state (includes the context)
|
* @param expressionState the current expression state (includes the context)
|
||||||
* @return true if the expression node will allow setValue()
|
* @return true if the expression node will allow setValue()
|
||||||
* @throws EvaluationException if something went wrong trying to determine if the node supports writing
|
* @throws EvaluationException if something went wrong trying to determine if the node supports writing
|
||||||
|
|
@ -77,7 +77,7 @@ public interface SpelNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the class of the object passed in, unless it is already a class object.
|
* Determine the class of the object passed in, unless it is already a class object.
|
||||||
* @param o the object that the caller wants the class of
|
* @param obj the object that the caller wants the class of
|
||||||
* @return the class of the object if it is not already a class object, or null if the object is null
|
* @return the class of the object if it is not already a class object, or null if the object is null
|
||||||
*/
|
*/
|
||||||
Class<?> getObjectClass(Object obj);
|
Class<?> getObjectClass(Object obj);
|
||||||
|
|
|
||||||
|
|
@ -1012,9 +1012,9 @@ public interface JdbcOperations {
|
||||||
* Each batch should be of size indicated in 'batchSize'.
|
* Each batch should be of size indicated in 'batchSize'.
|
||||||
* @param sql the SQL statement to execute.
|
* @param sql the SQL statement to execute.
|
||||||
* @param batchArgs the List of Object arrays containing the batch of arguments for the query
|
* @param batchArgs the List of Object arrays containing the batch of arguments for the query
|
||||||
* @param argTypes SQL types of the arguments
|
* @param batchSize batch size
|
||||||
* (constants from <code>java.sql.Types</code>)
|
* @param pss ParameterizedPreparedStatementSetter to use
|
||||||
* @return an array containing for each batch another array containing the numbers of rows affected
|
* @return an array containing for each batch another array containing the numbers of rows affected
|
||||||
* by each update in the batch
|
* by each update in the batch
|
||||||
*/
|
*/
|
||||||
public <T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize, ParameterizedPreparedStatementSetter<T> pss);
|
public <T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize, ParameterizedPreparedStatementSetter<T> pss);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -34,13 +34,13 @@ import java.sql.SQLException;
|
||||||
* @author Nicolas Fabre
|
* @author Nicolas Fabre
|
||||||
* @author Thomas Risberg
|
* @author Thomas Risberg
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see JdbcTemplate#batchUpdate(String sql, Collection<T> objs, int batchSize, ParameterizedPreparedStatementSetter<T> pss)
|
* @see JdbcTemplate#batchUpdate(String, java.util.Collection, int, ParameterizedPreparedStatementSetter)
|
||||||
*/
|
*/
|
||||||
public interface ParameterizedPreparedStatementSetter<T> {
|
public interface ParameterizedPreparedStatementSetter<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set parameter values on the given PreparedStatement.
|
* Set parameter values on the given PreparedStatement.
|
||||||
*
|
*
|
||||||
* @param ps the PreparedStatement to invoke setter methods on
|
* @param ps the PreparedStatement to invoke setter methods on
|
||||||
* @param argument the object containing the values to be set
|
* @param argument the object containing the values to be set
|
||||||
* @throws SQLException if a SQLException is encountered (i.e. there is no need to catch SQLException)
|
* @throws SQLException if a SQLException is encountered (i.e. there is no need to catch SQLException)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public interface EmbeddedDatabaseConfigurer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure the properties required to create and connect to the embedded database instance.
|
* Configure the properties required to create and connect to the embedded database instance.
|
||||||
* @param dataSource the data source to configure
|
* @param properties connection properties to configure
|
||||||
* @param databaseName the name of the test database
|
* @param databaseName the name of the test database
|
||||||
*/
|
*/
|
||||||
void configureConnectionProperties(ConnectionProperties properties, String databaseName);
|
void configureConnectionProperties(ConnectionProperties properties, String databaseName);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -346,7 +346,6 @@ public class MappingJacksonMessageConverter implements MessageConverter {
|
||||||
* <p>The default implementation parses the configured type id property name
|
* <p>The default implementation parses the configured type id property name
|
||||||
* and consults the configured type id mapping. This can be overridden with
|
* and consults the configured type id mapping. This can be overridden with
|
||||||
* a different strategy, e.g. doing some heuristics based on message origin.
|
* a different strategy, e.g. doing some heuristics based on message origin.
|
||||||
* @param object the payload object to set a type id for
|
|
||||||
* @param message the JMS Message to set the type id on
|
* @param message the JMS Message to set the type id on
|
||||||
* @throws JMSException if thrown by JMS methods
|
* @throws JMSException if thrown by JMS methods
|
||||||
* @see #setTypeIdOnMessage(Object, javax.jms.Message)
|
* @see #setTypeIdOnMessage(Object, javax.jms.Message)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package org.springframework.jms.support.converter;
|
||||||
/**
|
/**
|
||||||
* Constants that indicate a target message type to convert to: a
|
* Constants that indicate a target message type to convert to: a
|
||||||
* {@link javax.jms.TextMessage}, a {@link javax.jms.BytesMessage},
|
* {@link javax.jms.TextMessage}, a {@link javax.jms.BytesMessage},
|
||||||
* a {@link javax.jms.MapMessage} or an {@link ObjectMessage}.
|
* a {@link javax.jms.MapMessage} or an {@link javax.jms.ObjectMessage}.
|
||||||
*
|
*
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ public class LocalSessionFactoryBean extends HibernateExceptionTranslator
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify annotated entity classes to register with this Hibernate SessionFactory.
|
* Specify annotated entity classes to register with this Hibernate SessionFactory.
|
||||||
* @see org.hibernate.cfg.Configuration#addAnnotatedClass(String)
|
* @see org.hibernate.cfg.Configuration#addAnnotatedClass(Class)
|
||||||
*/
|
*/
|
||||||
public void setAnnotatedClasses(Class<?>[] annotatedClasses) {
|
public void setAnnotatedClasses(Class<?>[] annotatedClasses) {
|
||||||
this.annotatedClasses = annotatedClasses;
|
this.annotatedClasses = annotatedClasses;
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,6 @@ public class SqlMapClientFactoryBean implements FactoryBean<SqlMapClient>, Initi
|
||||||
* @see #setTransactionConfigProperties
|
* @see #setTransactionConfigProperties
|
||||||
* @see com.ibatis.sqlmap.client.SqlMapClient#getDataSource
|
* @see com.ibatis.sqlmap.client.SqlMapClient#getDataSource
|
||||||
* @see SqlMapClientTemplate#setDataSource
|
* @see SqlMapClientTemplate#setDataSource
|
||||||
* @see SqlMapClientTemplate#queryForPaginatedList
|
|
||||||
*/
|
*/
|
||||||
public void setDataSource(DataSource dataSource) {
|
public void setDataSource(DataSource dataSource) {
|
||||||
this.dataSource = dataSource;
|
this.dataSource = dataSource;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -228,7 +228,6 @@ public interface JdoOperations {
|
||||||
* to rely on auto-flushing at transaction completion.
|
* to rely on auto-flushing at transaction completion.
|
||||||
* @throws org.springframework.dao.DataAccessException in case of JDO errors
|
* @throws org.springframework.dao.DataAccessException in case of JDO errors
|
||||||
* @see javax.jdo.PersistenceManager#flush()
|
* @see javax.jdo.PersistenceManager#flush()
|
||||||
* @see JdoDialect#flush(javax.jdo.PersistenceManager)
|
|
||||||
*/
|
*/
|
||||||
void flush() throws DataAccessException;
|
void flush() throws DataAccessException;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -70,7 +70,7 @@ public class EclipseLinkJpaDialect extends DefaultJpaDialect {
|
||||||
* <p>It is only recommended to switch this flag to "true" when no JDBC access
|
* <p>It is only recommended to switch this flag to "true" when no JDBC access
|
||||||
* code is involved in any of the transactions, and when it is acceptable to
|
* code is involved in any of the transactions, and when it is acceptable to
|
||||||
* perform read operations outside of the transactional JDBC Connection.
|
* perform read operations outside of the transactional JDBC Connection.
|
||||||
* @see oracle.toplink.sessions.UnitOfWork#beginEarlyTransaction()
|
* @see org.eclipse.persistence.sessions.UnitOfWork#beginEarlyTransaction()
|
||||||
*/
|
*/
|
||||||
public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction) {
|
public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction) {
|
||||||
this.lazyDatabaseTransaction = lazyDatabaseTransaction;
|
this.lazyDatabaseTransaction = lazyDatabaseTransaction;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -68,7 +68,7 @@ public class TopLinkJpaDialect extends DefaultJpaDialect {
|
||||||
* <p>It is only recommended to switch this flag to "true" when no JDBC access
|
* <p>It is only recommended to switch this flag to "true" when no JDBC access
|
||||||
* code is involved in any of the transactions, and when it is acceptable to
|
* code is involved in any of the transactions, and when it is acceptable to
|
||||||
* perform read operations outside of the transactional JDBC Connection.
|
* perform read operations outside of the transactional JDBC Connection.
|
||||||
* @see oracle.toplink.sessions.UnitOfWork#beginEarlyTransaction()
|
* @see oracle.toplink.essentials.sessions.UnitOfWork#beginEarlyTransaction()
|
||||||
*/
|
*/
|
||||||
public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction) {
|
public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction) {
|
||||||
this.lazyDatabaseTransaction = lazyDatabaseTransaction;
|
this.lazyDatabaseTransaction = lazyDatabaseTransaction;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import java.lang.reflect.Type;
|
||||||
* Subinterface of {@link Marshaller} that has support for Java 5 generics.
|
* Subinterface of {@link Marshaller} that has support for Java 5 generics.
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @sicne 3.0.1
|
* @since 3.0.1
|
||||||
*/
|
*/
|
||||||
public interface GenericMarshaller extends Marshaller {
|
public interface GenericMarshaller extends Marshaller {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import java.lang.reflect.Type;
|
||||||
* Subinterface of {@link Unmarshaller} that has support for Java 5 generics.
|
* Subinterface of {@link Unmarshaller} that has support for Java 5 generics.
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @sicne 3.0.1
|
* @since 3.0.1
|
||||||
*/
|
*/
|
||||||
public interface GenericUnmarshaller extends Unmarshaller {
|
public interface GenericUnmarshaller extends Unmarshaller {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -362,7 +362,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether this unmarshaller should re-use objects. This will be only used when unmarshalling to existing
|
* Sets whether this unmarshaller should re-use objects. This will be only used when unmarshalling to existing
|
||||||
* object. </p> The default is {@link false}, which means that the objects won't be re-used.
|
* object. </p> The default is {@code false}, which means that the objects won't be re-used.
|
||||||
*
|
*
|
||||||
* @see org.exolab.castor.xml.Unmarshaller#setReuseObjects(boolean)
|
* @see org.exolab.castor.xml.Unmarshaller#setReuseObjects(boolean)
|
||||||
*/
|
*/
|
||||||
|
|
@ -371,7 +371,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether this unmarshaller should clear collections upon the first use. </p> The default is {@link false},
|
* Sets whether this unmarshaller should clear collections upon the first use. </p> The default is {@code false},
|
||||||
* which means that marshaller won't clear collections.
|
* which means that marshaller won't clear collections.
|
||||||
*
|
*
|
||||||
* @see org.exolab.castor.xml.Unmarshaller#setClearCollections(boolean)
|
* @see org.exolab.castor.xml.Unmarshaller#setClearCollections(boolean)
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ import org.springframework.web.util.WebUtils;
|
||||||
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
||||||
* @see org.springframework.web.context.WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
* @see org.springframework.web.context.WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
||||||
* @see org.springframework.web.context.ContextLoaderListener
|
* @see org.springframework.web.context.ContextLoaderListener
|
||||||
* @see org.springframework.web.context.ContextLoaderServlet
|
|
||||||
* @see DispatchActionSupport
|
* @see DispatchActionSupport
|
||||||
* @see LookupDispatchActionSupport
|
* @see LookupDispatchActionSupport
|
||||||
* @see MappingDispatchActionSupport
|
* @see MappingDispatchActionSupport
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@ import org.springframework.web.context.support.XmlWebApplicationContext;
|
||||||
* @see DelegatingRequestProcessor
|
* @see DelegatingRequestProcessor
|
||||||
* @see DelegatingTilesRequestProcessor
|
* @see DelegatingTilesRequestProcessor
|
||||||
* @see org.springframework.web.context.ContextLoaderListener
|
* @see org.springframework.web.context.ContextLoaderListener
|
||||||
* @see org.springframework.web.context.ContextLoaderServlet
|
|
||||||
* @see org.springframework.web.servlet.FrameworkServlet
|
* @see org.springframework.web.servlet.FrameworkServlet
|
||||||
* @deprecated as of Spring 3.0
|
* @deprecated as of Spring 3.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ import org.springframework.web.util.WebUtils;
|
||||||
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
||||||
* @see org.springframework.web.context.WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
* @see org.springframework.web.context.WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
||||||
* @see org.springframework.web.context.ContextLoaderListener
|
* @see org.springframework.web.context.ContextLoaderListener
|
||||||
* @see org.springframework.web.context.ContextLoaderServlet
|
|
||||||
* @see ActionSupport
|
* @see ActionSupport
|
||||||
* @see LookupDispatchActionSupport
|
* @see LookupDispatchActionSupport
|
||||||
* @see MappingDispatchActionSupport
|
* @see MappingDispatchActionSupport
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ import org.springframework.web.util.WebUtils;
|
||||||
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
||||||
* @see WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
* @see WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
||||||
* @see org.springframework.web.context.ContextLoaderListener
|
* @see org.springframework.web.context.ContextLoaderListener
|
||||||
* @see org.springframework.web.context.ContextLoaderServlet
|
|
||||||
* @see ActionSupport
|
* @see ActionSupport
|
||||||
* @see DispatchActionSupport
|
* @see DispatchActionSupport
|
||||||
* @see MappingDispatchActionSupport
|
* @see MappingDispatchActionSupport
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ import org.springframework.web.util.WebUtils;
|
||||||
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
* @see ContextLoaderPlugIn#SERVLET_CONTEXT_PREFIX
|
||||||
* @see WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
* @see WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE
|
||||||
* @see org.springframework.web.context.ContextLoaderListener
|
* @see org.springframework.web.context.ContextLoaderListener
|
||||||
* @see org.springframework.web.context.ContextLoaderServlet
|
|
||||||
* @see ActionSupport
|
* @see ActionSupport
|
||||||
* @see DispatchActionSupport
|
* @see DispatchActionSupport
|
||||||
* @see LookupDispatchActionSupport
|
* @see LookupDispatchActionSupport
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -23,10 +23,10 @@ import org.springframework.util.Assert;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>ContextConfigurationAttributes</code> encapsulates the context
|
* <code>ContextConfigurationAttributes</code> encapsulates the context
|
||||||
* configuration attributes declared on a test class via
|
* configuration attributes declared on a test class via
|
||||||
* {@link ContextConfiguration @ContextConfiguration}.
|
* {@link ContextConfiguration @ContextConfiguration}.
|
||||||
*
|
*
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see ContextConfiguration
|
* @see ContextConfiguration
|
||||||
|
|
@ -52,7 +52,7 @@ public class ContextConfigurationAttributes {
|
||||||
* Resolve resource locations from the {@link ContextConfiguration#locations() locations}
|
* Resolve resource locations from the {@link ContextConfiguration#locations() locations}
|
||||||
* and {@link ContextConfiguration#value() value} attributes of the supplied
|
* and {@link ContextConfiguration#value() value} attributes of the supplied
|
||||||
* {@link ContextConfiguration} annotation.
|
* {@link ContextConfiguration} annotation.
|
||||||
*
|
*
|
||||||
* @throws IllegalStateException if both the locations and value attributes have been declared
|
* @throws IllegalStateException if both the locations and value attributes have been declared
|
||||||
*/
|
*/
|
||||||
private static String[] resolveLocations(Class<?> declaringClass, ContextConfiguration contextConfiguration) {
|
private static String[] resolveLocations(Class<?> declaringClass, ContextConfiguration contextConfiguration) {
|
||||||
|
|
@ -81,7 +81,7 @@ public class ContextConfigurationAttributes {
|
||||||
* supplied {@link ContextConfiguration @ContextConfiguration} annotation and
|
* supplied {@link ContextConfiguration @ContextConfiguration} annotation and
|
||||||
* the {@link Class test class} that declared it.
|
* the {@link Class test class} that declared it.
|
||||||
* @param declaringClass the test class that declared {@code @ContextConfiguration}
|
* @param declaringClass the test class that declared {@code @ContextConfiguration}
|
||||||
* @param contextConfiguration the annotation from which to retrieve the attributes
|
* @param contextConfiguration the annotation from which to retrieve the attributes
|
||||||
*/
|
*/
|
||||||
public ContextConfigurationAttributes(Class<?> declaringClass, ContextConfiguration contextConfiguration) {
|
public ContextConfigurationAttributes(Class<?> declaringClass, ContextConfiguration contextConfiguration) {
|
||||||
this(declaringClass, resolveLocations(declaringClass, contextConfiguration), contextConfiguration.classes(),
|
this(declaringClass, resolveLocations(declaringClass, contextConfiguration), contextConfiguration.classes(),
|
||||||
|
|
@ -93,14 +93,14 @@ public class ContextConfigurationAttributes {
|
||||||
* {@link Class test class} that declared the
|
* {@link Class test class} that declared the
|
||||||
* {@link ContextConfiguration @ContextConfiguration} annotation and its
|
* {@link ContextConfiguration @ContextConfiguration} annotation and its
|
||||||
* corresponding attributes.
|
* corresponding attributes.
|
||||||
*
|
*
|
||||||
* @param declaringClass the test class that declared {@code @ContextConfiguration}
|
* @param declaringClass the test class that declared {@code @ContextConfiguration}
|
||||||
* @param locations the resource locations declared via {@code @ContextConfiguration}
|
* @param locations the resource locations declared via {@code @ContextConfiguration}
|
||||||
* @param classes the configuration classes declared via {@code @ContextConfiguration}
|
* @param classes the configuration classes declared via {@code @ContextConfiguration}
|
||||||
* @param inheritLocations the <code>inheritLocations</code> flag declared via {@code @ContextConfiguration}
|
* @param inheritLocations the <code>inheritLocations</code> flag declared via {@code @ContextConfiguration}
|
||||||
* @param contextLoaderClass the {@code ContextLoader} class declared via {@code @ContextConfiguration}
|
* @param contextLoaderClass the {@code ContextLoader} class declared via {@code @ContextConfiguration}
|
||||||
* @throws IllegalArgumentException if the {@code declaringClass} or {@code contextLoaderClass} is
|
* @throws IllegalArgumentException if the {@code declaringClass} or {@code contextLoaderClass} is
|
||||||
* <code>null</code>, or if the {@code locations} and {@code classes} are both non-empty
|
* <code>null</code>, or if the {@code locations} and {@code classes} are both non-empty
|
||||||
*/
|
*/
|
||||||
public ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes,
|
public ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes,
|
||||||
boolean inheritLocations, Class<? extends ContextLoader> contextLoaderClass) {
|
boolean inheritLocations, Class<? extends ContextLoader> contextLoaderClass) {
|
||||||
|
|
@ -138,12 +138,12 @@ public class ContextConfigurationAttributes {
|
||||||
* Get the resource locations that were declared via
|
* Get the resource locations that were declared via
|
||||||
* {@link ContextConfiguration @ContextConfiguration}.
|
* {@link ContextConfiguration @ContextConfiguration}.
|
||||||
* <p>Note: this is a mutable property. The returned value may therefore
|
* <p>Note: this is a mutable property. The returned value may therefore
|
||||||
* represent a <em>processed</em> value that does not match the original value
|
* represent a <em>processed</em> value that does not match the original value
|
||||||
* declared via {@link ContextConfiguration @ContextConfiguration}.
|
* declared via {@link ContextConfiguration @ContextConfiguration}.
|
||||||
* @return the resource locations; potentially <code>null</code> or <em>empty</em>
|
* @return the resource locations; potentially <code>null</code> or <em>empty</em>
|
||||||
* @see ContextConfiguration#value
|
* @see ContextConfiguration#value
|
||||||
* @see ContextConfiguration#locations
|
* @see ContextConfiguration#locations
|
||||||
* @see #setLocations()
|
* @see #setLocations(String[])
|
||||||
*/
|
*/
|
||||||
public String[] getLocations() {
|
public String[] getLocations() {
|
||||||
return locations;
|
return locations;
|
||||||
|
|
@ -162,11 +162,11 @@ public class ContextConfigurationAttributes {
|
||||||
* Get the configuration classes that were declared via
|
* Get the configuration classes that were declared via
|
||||||
* {@link ContextConfiguration @ContextConfiguration}.
|
* {@link ContextConfiguration @ContextConfiguration}.
|
||||||
* <p>Note: this is a mutable property. The returned value may therefore
|
* <p>Note: this is a mutable property. The returned value may therefore
|
||||||
* represent a <em>processed</em> value that does not match the original value
|
* represent a <em>processed</em> value that does not match the original value
|
||||||
* declared via {@link ContextConfiguration @ContextConfiguration}.
|
* declared via {@link ContextConfiguration @ContextConfiguration}.
|
||||||
* @return the configuration classes; potentially <code>null</code> or <em>empty</em>
|
* @return the configuration classes; potentially <code>null</code> or <em>empty</em>
|
||||||
* @see ContextConfiguration#classes
|
* @see ContextConfiguration#classes
|
||||||
* @see #setClasses()
|
* @see #setClasses(Class[])
|
||||||
*/
|
*/
|
||||||
public Class<?>[] getClasses() {
|
public Class<?>[] getClasses() {
|
||||||
return classes;
|
return classes;
|
||||||
|
|
@ -182,7 +182,7 @@ public class ContextConfigurationAttributes {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if this {@code ContextConfigurationAttributes} instance has
|
* Determine if this {@code ContextConfigurationAttributes} instance has
|
||||||
* path-based resource locations.
|
* path-based resource locations.
|
||||||
* @return <code>true</code> if the {@link #getLocations() locations} array is not empty
|
* @return <code>true</code> if the {@link #getLocations() locations} array is not empty
|
||||||
* @see #hasResources()
|
* @see #hasResources()
|
||||||
|
|
@ -193,7 +193,7 @@ public class ContextConfigurationAttributes {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if this {@code ContextConfigurationAttributes} instance has
|
* Determine if this {@code ContextConfigurationAttributes} instance has
|
||||||
* class-based resources.
|
* class-based resources.
|
||||||
* @return <code>true</code> if the {@link #getClasses() classes} array is not empty
|
* @return <code>true</code> if the {@link #getClasses() classes} array is not empty
|
||||||
* @see #hasResources()
|
* @see #hasResources()
|
||||||
|
|
@ -204,7 +204,7 @@ public class ContextConfigurationAttributes {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if this {@code ContextConfigurationAttributes} instance has
|
* Determine if this {@code ContextConfigurationAttributes} instance has
|
||||||
* either path-based resource locations or class-based resources.
|
* either path-based resource locations or class-based resources.
|
||||||
* @return <code>true</code> if either the {@link #getLocations() locations}
|
* @return <code>true</code> if either the {@link #getLocations() locations}
|
||||||
* or the {@link #getClasses() classes} array is not empty
|
* or the {@link #getClasses() classes} array is not empty
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -21,7 +21,7 @@ import org.springframework.context.ApplicationContext;
|
||||||
/**
|
/**
|
||||||
* Strategy interface for loading an {@link ApplicationContext application context}
|
* Strategy interface for loading an {@link ApplicationContext application context}
|
||||||
* for an integration test managed by the Spring TestContext Framework.
|
* for an integration test managed by the Spring TestContext Framework.
|
||||||
*
|
*
|
||||||
* <p>The {@code SmartContextLoader} SPI supersedes the {@link ContextLoader} SPI
|
* <p>The {@code SmartContextLoader} SPI supersedes the {@link ContextLoader} SPI
|
||||||
* introduced in Spring 2.5: a {@code SmartContextLoader} can choose to process
|
* introduced in Spring 2.5: a {@code SmartContextLoader} can choose to process
|
||||||
* either resource locations or configuration classes. Furthermore, a
|
* either resource locations or configuration classes. Furthermore, a
|
||||||
|
|
@ -34,13 +34,13 @@ import org.springframework.context.ApplicationContext;
|
||||||
* processContextConfiguration()} prior to calling
|
* processContextConfiguration()} prior to calling
|
||||||
* {@link #loadContext(MergedContextConfiguration) loadContext()}. This gives a
|
* {@link #loadContext(MergedContextConfiguration) loadContext()}. This gives a
|
||||||
* {@code SmartContextLoader} the opportunity to provide custom support for
|
* {@code SmartContextLoader} the opportunity to provide custom support for
|
||||||
* modifying resource locations or detecting default resource locations or
|
* modifying resource locations or detecting default resource locations or
|
||||||
* default configuration classes. The results of
|
* default configuration classes. The results of
|
||||||
* {@link #processContextConfiguration(ContextConfigurationAttributes)
|
* {@link #processContextConfiguration(ContextConfigurationAttributes)
|
||||||
* processContextConfiguration()} should be merged for all classes in the
|
* processContextConfiguration()} should be merged for all classes in the
|
||||||
* hierarchy of the root test class and then supplied to
|
* hierarchy of the root test class and then supplied to
|
||||||
* {@link #loadContext(MergedContextConfiguration) loadContext()}.
|
* {@link #loadContext(MergedContextConfiguration) loadContext()}.
|
||||||
*
|
*
|
||||||
* <p>Even though {@code SmartContextLoader} extends {@code ContextLoader},
|
* <p>Even though {@code SmartContextLoader} extends {@code ContextLoader},
|
||||||
* clients should favor {@code SmartContextLoader}-specific methods over those
|
* clients should favor {@code SmartContextLoader}-specific methods over those
|
||||||
* defined in {@code ContextLoader}, particularly because a
|
* defined in {@code ContextLoader}, particularly because a
|
||||||
|
|
@ -97,7 +97,7 @@ public interface SmartContextLoader extends ContextLoader {
|
||||||
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired},
|
* {@link org.springframework.beans.factory.annotation.Autowired @Autowired},
|
||||||
* {@link javax.annotation.Resource @Resource}, and
|
* {@link javax.annotation.Resource @Resource}, and
|
||||||
* {@link javax.inject.Inject @Inject}. In addition, concrete implementations
|
* {@link javax.inject.Inject @Inject}. In addition, concrete implementations
|
||||||
* should set the active bean definition profiles in the context's
|
* should set the active bean definition profiles in the context's
|
||||||
* {@link org.springframework.core.env.Environment Environment}.
|
* {@link org.springframework.core.env.Environment Environment}.
|
||||||
* <p>Any <code>ApplicationContext</code> loaded by a
|
* <p>Any <code>ApplicationContext</code> loaded by a
|
||||||
* {@code SmartContextLoader} <strong>must</strong> register a JVM
|
* {@code SmartContextLoader} <strong>must</strong> register a JVM
|
||||||
|
|
@ -110,7 +110,8 @@ public interface SmartContextLoader extends ContextLoader {
|
||||||
* @return a new application context
|
* @return a new application context
|
||||||
* @throws Exception if context loading failed
|
* @throws Exception if context loading failed
|
||||||
* @see #processContextConfiguration(ContextConfigurationAttributes)
|
* @see #processContextConfiguration(ContextConfigurationAttributes)
|
||||||
* @see org.springframework.context.annotation.AnnotationConfigUtils#registerAnnotationConfigProcessors()
|
* @see org.springframework.context.annotation.AnnotationConfigUtils
|
||||||
|
* #registerAnnotationConfigProcessors(org.springframework.beans.factory.support.BeanDefinitionRegistry)
|
||||||
* @see org.springframework.test.context.MergedContextConfiguration#getActiveProfiles()
|
* @see org.springframework.test.context.MergedContextConfiguration#getActiveProfiles()
|
||||||
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment()
|
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment()
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -28,9 +28,9 @@ import org.springframework.test.context.TestContextManager;
|
||||||
* <code>RunAfterTestMethodCallbacks</code> is a custom JUnit 4.5+
|
* <code>RunAfterTestMethodCallbacks</code> is a custom JUnit 4.5+
|
||||||
* {@link Statement} which allows the <em>Spring TestContext Framework</em> to
|
* {@link Statement} which allows the <em>Spring TestContext Framework</em> to
|
||||||
* be plugged into the JUnit execution chain by calling
|
* be plugged into the JUnit execution chain by calling
|
||||||
* {@link TestContextManager#afterTestMethod(Object, Method) afterTestMethod()}
|
* {@link TestContextManager#afterTestMethod(Object, Method, Throwable) afterTestMethod()}
|
||||||
* on the supplied {@link TestContextManager}.
|
* on the supplied {@link TestContextManager}.
|
||||||
*
|
*
|
||||||
* @see #evaluate()
|
* @see #evaluate()
|
||||||
* @see RunBeforeTestMethodCallbacks
|
* @see RunBeforeTestMethodCallbacks
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
|
|
@ -50,7 +50,7 @@ public class RunAfterTestMethodCallbacks extends Statement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new <code>RunAfterTestMethodCallbacks</code> statement.
|
* Constructs a new <code>RunAfterTestMethodCallbacks</code> statement.
|
||||||
*
|
*
|
||||||
* @param next the next <code>Statement</code> in the execution chain
|
* @param next the next <code>Statement</code> in the execution chain
|
||||||
* @param testInstance the current test instance (never <code>null</code>)
|
* @param testInstance the current test instance (never <code>null</code>)
|
||||||
* @param testMethod the test method which has just been executed on the
|
* @param testMethod the test method which has just been executed on the
|
||||||
|
|
@ -70,7 +70,7 @@ public class RunAfterTestMethodCallbacks extends Statement {
|
||||||
* Invokes the next {@link Statement} in the execution chain (typically an
|
* Invokes the next {@link Statement} in the execution chain (typically an
|
||||||
* instance of {@link org.junit.internal.runners.statements.RunAfters
|
* instance of {@link org.junit.internal.runners.statements.RunAfters
|
||||||
* RunAfters}), catching any exceptions thrown, and then calls
|
* RunAfters}), catching any exceptions thrown, and then calls
|
||||||
* {@link TestContextManager#afterTestMethod(Object, Method)} with the first
|
* {@link TestContextManager#afterTestMethod(Object, Method, Throwable)} with the first
|
||||||
* caught exception (if any). If the call to <code>afterTestMethod()</code>
|
* caught exception (if any). If the call to <code>afterTestMethod()</code>
|
||||||
* throws an exception, it will also be tracked. Multiple exceptions will be
|
* throws an exception, it will also be tracked. Multiple exceptions will be
|
||||||
* combined into a {@link MultipleFailureException}.
|
* combined into a {@link MultipleFailureException}.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -35,11 +35,12 @@ import org.springframework.util.StringUtils;
|
||||||
* implementations of the {@link ContextLoader} SPI. Provides a
|
* implementations of the {@link ContextLoader} SPI. Provides a
|
||||||
* <em>Template Method</em> based approach for {@link #processLocations processing}
|
* <em>Template Method</em> based approach for {@link #processLocations processing}
|
||||||
* resource locations.
|
* resource locations.
|
||||||
*
|
*
|
||||||
* <p>As of Spring 3.1, <code>AbstractContextLoader</code> also provides a basis
|
* <p>As of Spring 3.1, <code>AbstractContextLoader</code> also provides a basis
|
||||||
* for all concrete implementations of the {@link SmartContextLoader} SPI. For
|
* for all concrete implementations of the {@link SmartContextLoader} SPI. For
|
||||||
* backwards compatibility with the {@code ContextLoader} SPI,
|
* backwards compatibility with the {@code ContextLoader} SPI,
|
||||||
* {@link #processContextConfiguration()} delegates to {@link #processLocations()}.
|
* {@link #processContextConfiguration(ContextConfigurationAttributes)} delegates
|
||||||
|
* to {@link #processLocations(Class, String...)}.
|
||||||
*
|
*
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
|
|
@ -59,7 +60,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For backwards compatibility with the {@link ContextLoader} SPI, the
|
* For backwards compatibility with the {@link ContextLoader} SPI, the
|
||||||
* default implementation simply delegates to {@link #processLocations()},
|
* default implementation simply delegates to {@link #processLocations(Class, String...)},
|
||||||
* passing it the {@link ContextConfigurationAttributes#getDeclaringClass()
|
* passing it the {@link ContextConfigurationAttributes#getDeclaringClass()
|
||||||
* declaring class} and {@link ContextConfigurationAttributes#getLocations()
|
* declaring class} and {@link ContextConfigurationAttributes#getLocations()
|
||||||
* resource locations} retrieved from the supplied
|
* resource locations} retrieved from the supplied
|
||||||
|
|
@ -70,7 +71,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
|
||||||
* <p>Can be overridden in subclasses — for example, to process
|
* <p>Can be overridden in subclasses — for example, to process
|
||||||
* configuration classes instead of resource locations.
|
* configuration classes instead of resource locations.
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see #processLocations()
|
* @see #processLocations(Class, String...)
|
||||||
*/
|
*/
|
||||||
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
|
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
|
||||||
String[] processedLocations = processLocations(configAttributes.getDeclaringClass(),
|
String[] processedLocations = processLocations(configAttributes.getDeclaringClass(),
|
||||||
|
|
@ -96,10 +97,10 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
|
||||||
* @return a processed array of application context resource locations
|
* @return a processed array of application context resource locations
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
* @see #isGenerateDefaultLocations()
|
* @see #isGenerateDefaultLocations()
|
||||||
* @see #generateDefaultLocations()
|
* @see #generateDefaultLocations(Class)
|
||||||
* @see #modifyLocations()
|
* @see #modifyLocations(Class, String...)
|
||||||
* @see org.springframework.test.context.ContextLoader#processLocations()
|
* @see org.springframework.test.context.ContextLoader#processLocations(Class, String...)
|
||||||
* @see #processContextConfiguration()
|
* @see #processContextConfiguration(ContextConfigurationAttributes)
|
||||||
*/
|
*/
|
||||||
public final String[] processLocations(Class<?> clazz, String... locations) {
|
public final String[] processLocations(Class<?> clazz, String... locations) {
|
||||||
return (ObjectUtils.isEmpty(locations) && isGenerateDefaultLocations()) ? generateDefaultLocations(clazz)
|
return (ObjectUtils.isEmpty(locations) && isGenerateDefaultLocations()) ? generateDefaultLocations(clazz)
|
||||||
|
|
@ -115,7 +116,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
|
||||||
* where <code><suffix></code> is the value of the
|
* where <code><suffix></code> is the value of the
|
||||||
* {@link #getResourceSuffix() resource suffix} string.
|
* {@link #getResourceSuffix() resource suffix} string.
|
||||||
* <p>As of Spring 3.1, the implementation of this method adheres to the
|
* <p>As of Spring 3.1, the implementation of this method adheres to the
|
||||||
* contract defined in the {@link SmartContextLoader} SPI. Specifically,
|
* contract defined in the {@link SmartContextLoader} SPI. Specifically,
|
||||||
* this method will <em>preemptively</em> verify that the generated default
|
* this method will <em>preemptively</em> verify that the generated default
|
||||||
* location actually exists. If it does not exist, this method will log a
|
* location actually exists. If it does not exist, this method will log a
|
||||||
* warning and return an empty array.
|
* warning and return an empty array.
|
||||||
|
|
@ -189,14 +190,15 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
|
||||||
/**
|
/**
|
||||||
* Determine whether or not <em>default</em> resource locations should be
|
* Determine whether or not <em>default</em> resource locations should be
|
||||||
* generated if the <code>locations</code> provided to
|
* generated if the <code>locations</code> provided to
|
||||||
* {@link #processLocations()} are <code>null</code> or empty.
|
* {@link #processLocations(Class, String...)} are <code>null</code> or empty.
|
||||||
* <p>As of Spring 3.1, the semantics of this method have been overloaded
|
* <p>As of Spring 3.1, the semantics of this method have been overloaded
|
||||||
* to include detection of either default resource locations or default
|
* to include detection of either default resource locations or default
|
||||||
* configuration classes. Consequently, this method can also be used to
|
* configuration classes. Consequently, this method can also be used to
|
||||||
* determine whether or not <em>default</em> configuration classes should be
|
* determine whether or not <em>default</em> configuration classes should be
|
||||||
* detected if the <code>classes</code> present in the
|
* detected if the <code>classes</code> present in the
|
||||||
* {@link ContextConfigurationAttributes configuration attributes} supplied
|
* {@link ContextConfigurationAttributes configuration attributes} supplied
|
||||||
* to {@link #processContextConfiguration()} are <code>null</code> or empty.
|
* to {@link #processContextConfiguration(ContextConfigurationAttributes)}
|
||||||
|
* are <code>null</code> or empty.
|
||||||
* <p>Can be overridden by subclasses to change the default behavior.
|
* <p>Can be overridden by subclasses to change the default behavior.
|
||||||
* @return always <code>true</code> by default
|
* @return always <code>true</code> by default
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
|
|
@ -211,7 +213,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
|
||||||
* <p>Must be implemented by subclasses.
|
* <p>Must be implemented by subclasses.
|
||||||
* @return the resource suffix; should not be <code>null</code> or empty
|
* @return the resource suffix; should not be <code>null</code> or empty
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
* @see #generateDefaultLocations()
|
* @see #generateDefaultLocations(Class)
|
||||||
*/
|
*/
|
||||||
protected abstract String getResourceSuffix();
|
protected abstract String getResourceSuffix();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -29,7 +29,7 @@ import org.springframework.util.StringUtils;
|
||||||
/**
|
/**
|
||||||
* Abstract, generic extension of {@link AbstractContextLoader} that loads a
|
* Abstract, generic extension of {@link AbstractContextLoader} that loads a
|
||||||
* {@link GenericApplicationContext}.
|
* {@link GenericApplicationContext}.
|
||||||
*
|
*
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>If instances of concrete subclasses are invoked via the
|
* <li>If instances of concrete subclasses are invoked via the
|
||||||
* {@link org.springframework.test.context.ContextLoader ContextLoader} SPI, the
|
* {@link org.springframework.test.context.ContextLoader ContextLoader} SPI, the
|
||||||
|
|
@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
|
||||||
* <li>If instances of concrete subclasses are invoked via the
|
* <li>If instances of concrete subclasses are invoked via the
|
||||||
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
|
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
|
||||||
* SPI, the context will be loaded from the {@link MergedContextConfiguration}
|
* SPI, the context will be loaded from the {@link MergedContextConfiguration}
|
||||||
* provided to {@link #loadContext(MergedContextConfiguration)}. In such cases, a
|
* provided to {@link #loadContext(MergedContextConfiguration)}. In such cases, a
|
||||||
* <code>SmartContextLoader</code> will decide whether to load the context from
|
* <code>SmartContextLoader</code> will decide whether to load the context from
|
||||||
* <em>locations</em> or
|
* <em>locations</em> or
|
||||||
* {@link org.springframework.context.annotation.Configuration configuration classes}.</li>
|
* {@link org.springframework.context.annotation.Configuration configuration classes}.</li>
|
||||||
|
|
@ -68,17 +68,17 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
|
||||||
* <li>Sets the <em>active bean definition profiles</em> from the supplied
|
* <li>Sets the <em>active bean definition profiles</em> from the supplied
|
||||||
* <code>MergedContextConfiguration</code> in the
|
* <code>MergedContextConfiguration</code> in the
|
||||||
* {@link org.springframework.core.env.Environment Environment} of the context.</li>
|
* {@link org.springframework.core.env.Environment Environment} of the context.</li>
|
||||||
* <li>Calls {@link #prepareContext()} to allow for customizing the context
|
* <li>Calls {@link #prepareContext(GenericApplicationContext)} to allow for customizing the context
|
||||||
* before bean definitions are loaded.</li>
|
* before bean definitions are loaded.</li>
|
||||||
* <li>Calls {@link #customizeBeanFactory()} to allow for customizing the
|
* <li>Calls {@link #customizeBeanFactory(DefaultListableBeanFactory)} to allow for customizing the
|
||||||
* context's <code>DefaultListableBeanFactory</code>.</li>
|
* context's <code>DefaultListableBeanFactory</code>.</li>
|
||||||
* <li>Delegates to {@link #loadBeanDefinitions()} to populate the context
|
* <li>Delegates to {@link #loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration)}
|
||||||
* from the configuration locations or classes in the supplied
|
* to populate the context from the configuration locations or classes in the supplied
|
||||||
* <code>MergedContextConfiguration</code>.</li>
|
* <code>MergedContextConfiguration</code>.</li>
|
||||||
* <li>Delegates to {@link AnnotationConfigUtils} for
|
* <li>Delegates to {@link AnnotationConfigUtils} for
|
||||||
* {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering}
|
* {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering}
|
||||||
* annotation configuration processors.</li>
|
* annotation configuration processors.</li>
|
||||||
* <li>Calls {@link #customizeContext()} to allow for customizing the context
|
* <li>Calls {@link #customizeContext(GenericApplicationContext)} to allow for customizing the context
|
||||||
* before it is refreshed.</li>
|
* before it is refreshed.</li>
|
||||||
* <li>{@link ConfigurableApplicationContext#refresh Refreshes} the
|
* <li>{@link ConfigurableApplicationContext#refresh Refreshes} the
|
||||||
* context and registers a JVM shutdown hook for it.</li>
|
* context and registers a JVM shutdown hook for it.</li>
|
||||||
|
|
@ -110,17 +110,17 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
|
||||||
* <p>Implementation details:
|
* <p>Implementation details:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Creates a {@link GenericApplicationContext} instance.</li>
|
* <li>Creates a {@link GenericApplicationContext} instance.</li>
|
||||||
* <li>Calls {@link #prepareContext()} to allow for customizing the context
|
* <li>Calls {@link #prepareContext(GenericApplicationContext)} to allow for customizing the context
|
||||||
* before bean definitions are loaded.</li>
|
* before bean definitions are loaded.</li>
|
||||||
* <li>Calls {@link #customizeBeanFactory()} to allow for customizing the
|
* <li>Calls {@link #customizeBeanFactory(DefaultListableBeanFactory)} to allow for customizing the
|
||||||
* context's <code>DefaultListableBeanFactory</code>.</li>
|
* context's <code>DefaultListableBeanFactory</code>.</li>
|
||||||
* <li>Delegates to {@link #createBeanDefinitionReader()} to create a
|
* <li>Delegates to {@link #createBeanDefinitionReader(GenericApplicationContext)} to create a
|
||||||
* {@link BeanDefinitionReader} which is then used to populate the context
|
* {@link BeanDefinitionReader} which is then used to populate the context
|
||||||
* from the specified config locations.</li>
|
* from the specified config locations.</li>
|
||||||
* <li>Delegates to {@link AnnotationConfigUtils} for
|
* <li>Delegates to {@link AnnotationConfigUtils} for
|
||||||
* {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering}
|
* {@link AnnotationConfigUtils#registerAnnotationConfigProcessors registering}
|
||||||
* annotation configuration processors.</li>
|
* annotation configuration processors.</li>
|
||||||
* <li>Calls {@link #customizeContext()} to allow for customizing the context
|
* <li>Calls {@link #customizeContext(GenericApplicationContext)} to allow for customizing the context
|
||||||
* before it is refreshed.</li>
|
* before it is refreshed.</li>
|
||||||
* <li>{@link ConfigurableApplicationContext#refresh Refreshes} the
|
* <li>{@link ConfigurableApplicationContext#refresh Refreshes} the
|
||||||
* context and registers a JVM shutdown hook for it.</li>
|
* context and registers a JVM shutdown hook for it.</li>
|
||||||
|
|
@ -188,16 +188,16 @@ public abstract class AbstractGenericContextLoader extends AbstractContextLoader
|
||||||
* from the configuration locations or classes in the supplied
|
* from the configuration locations or classes in the supplied
|
||||||
* <code>MergedContextConfiguration</code>.</li>
|
* <code>MergedContextConfiguration</code>.</li>
|
||||||
* <p>The default implementation delegates to the {@link BeanDefinitionReader}
|
* <p>The default implementation delegates to the {@link BeanDefinitionReader}
|
||||||
* returned by {@link #createBeanDefinitionReader()} to
|
* returned by {@link #createBeanDefinitionReader(GenericApplicationContext)} to
|
||||||
* {@link BeanDefinitionReader#loadBeanDefinitions(String) load} the
|
* {@link BeanDefinitionReader#loadBeanDefinitions(String) load} the
|
||||||
* bean definitions.
|
* bean definitions.
|
||||||
* <p>Subclasses must provide an appropriate implementation of
|
* <p>Subclasses must provide an appropriate implementation of
|
||||||
* {@link #createBeanDefinitionReader()}. Alternatively subclasses may
|
* {@link #createBeanDefinitionReader(GenericApplicationContext)}. Alternatively subclasses may
|
||||||
* provide a <em>no-op</em> implementation of {@code createBeanDefinitionReader()}
|
* provide a <em>no-op</em> implementation of {@code createBeanDefinitionReader()}
|
||||||
* and override this method to provide a custom strategy for loading or
|
* and override this method to provide a custom strategy for loading or
|
||||||
* registering bean definitions.
|
* registering bean definitions.
|
||||||
* @param context the context into which the bean definitions should be loaded
|
* @param context the context into which the bean definitions should be loaded
|
||||||
* @param mergedConfig the merged context configuration
|
* @param mergedConfig the merged context configuration
|
||||||
* @see #loadContext(MergedContextConfiguration)
|
* @see #loadContext(MergedContextConfiguration)
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -35,7 +35,7 @@ import org.springframework.util.ObjectUtils;
|
||||||
* Concrete implementation of {@link AbstractGenericContextLoader} that loads
|
* Concrete implementation of {@link AbstractGenericContextLoader} that loads
|
||||||
* bean definitions from
|
* bean definitions from
|
||||||
* {@link org.springframework.context.annotation.Configuration configuration classes}.
|
* {@link org.springframework.context.annotation.Configuration configuration classes}.
|
||||||
*
|
*
|
||||||
* <p>Note: <code>AnnotationConfigContextLoader</code> supports
|
* <p>Note: <code>AnnotationConfigContextLoader</code> supports
|
||||||
* {@link org.springframework.context.annotation.Configuration configuration classes}
|
* {@link org.springframework.context.annotation.Configuration configuration classes}
|
||||||
* rather than the String-based resource locations defined by the legacy
|
* rather than the String-based resource locations defined by the legacy
|
||||||
|
|
@ -46,13 +46,13 @@ import org.springframework.util.ObjectUtils;
|
||||||
* <code>AbstractContextLoader</code> or <code>AbstractGenericContextLoader</code>.
|
* <code>AbstractContextLoader</code> or <code>AbstractGenericContextLoader</code>.
|
||||||
* Consequently, <code>AnnotationConfigContextLoader</code> should chiefly be
|
* Consequently, <code>AnnotationConfigContextLoader</code> should chiefly be
|
||||||
* considered a {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
|
* considered a {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
|
||||||
* rather than a {@link org.springframework.test.context.ContextLoader ContextLoader}.
|
* rather than a {@link org.springframework.test.context.ContextLoader ContextLoader}.
|
||||||
*
|
*
|
||||||
* @author Sam Brannen
|
* @author Sam Brannen
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
* @see #processContextConfiguration()
|
* @see #processContextConfiguration(ContextConfigurationAttributes)
|
||||||
* @see #detectDefaultConfigurationClasses()
|
* @see #detectDefaultConfigurationClasses(Class)
|
||||||
* @see #loadBeanDefinitions()
|
* @see #loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration)
|
||||||
*/
|
*/
|
||||||
public class AnnotationConfigContextLoader extends AbstractGenericContextLoader {
|
public class AnnotationConfigContextLoader extends AbstractGenericContextLoader {
|
||||||
|
|
||||||
|
|
@ -72,9 +72,9 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
|
||||||
* supplied configuration attributes. Otherwise, properties in the supplied
|
* supplied configuration attributes. Otherwise, properties in the supplied
|
||||||
* configuration attributes will not be modified.
|
* configuration attributes will not be modified.
|
||||||
* @param configAttributes the context configuration attributes to process
|
* @param configAttributes the context configuration attributes to process
|
||||||
* @see org.springframework.test.context.SmartContextLoader#processContextConfiguration()
|
* @see org.springframework.test.context.SmartContextLoader#processContextConfiguration(ContextConfigurationAttributes)
|
||||||
* @see #isGenerateDefaultLocations()
|
* @see #isGenerateDefaultLocations()
|
||||||
* @see #detectDefaultConfigurationClasses()
|
* @see #detectDefaultConfigurationClasses(Class)
|
||||||
*/
|
*/
|
||||||
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
|
public void processContextConfiguration(ContextConfigurationAttributes configAttributes) {
|
||||||
if (ObjectUtils.isEmpty(configAttributes.getClasses()) && isGenerateDefaultLocations()) {
|
if (ObjectUtils.isEmpty(configAttributes.getClasses()) && isGenerateDefaultLocations()) {
|
||||||
|
|
@ -117,7 +117,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
|
||||||
* {@link Configuration @Configuration}.
|
* {@link Configuration @Configuration}.
|
||||||
* <p>The implementation of this method adheres to the contract defined in the
|
* <p>The implementation of this method adheres to the contract defined in the
|
||||||
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
|
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader}
|
||||||
* SPI. Specifically, this method uses introspection to detect default
|
* SPI. Specifically, this method uses introspection to detect default
|
||||||
* configuration classes that comply with the constraints required of
|
* configuration classes that comply with the constraints required of
|
||||||
* {@code @Configuration} class implementations. If a potential candidate
|
* {@code @Configuration} class implementations. If a potential candidate
|
||||||
* configuration class does meet these requirements, this method will log a
|
* configuration class does meet these requirements, this method will log a
|
||||||
|
|
@ -187,7 +187,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>AnnotationConfigContextLoader</code> should be used as a
|
* <code>AnnotationConfigContextLoader</code> should be used as a
|
||||||
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader},
|
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader},
|
||||||
* not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}.
|
* not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}.
|
||||||
* Consequently, this method is not supported.
|
* Consequently, this method is not supported.
|
||||||
|
|
@ -226,7 +226,7 @@ public class AnnotationConfigContextLoader extends AbstractGenericContextLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>AnnotationConfigContextLoader</code> should be used as a
|
* <code>AnnotationConfigContextLoader</code> should be used as a
|
||||||
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader},
|
* {@link org.springframework.test.context.SmartContextLoader SmartContextLoader},
|
||||||
* not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}.
|
* not as a legacy {@link org.springframework.test.context.ContextLoader ContextLoader}.
|
||||||
* Consequently, this method is not supported.
|
* Consequently, this method is not supported.
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public abstract class JBossWorkManagerUtils {
|
||||||
/**
|
/**
|
||||||
* Obtain the default JBoss JCA WorkManager through a JMX lookup
|
* Obtain the default JBoss JCA WorkManager through a JMX lookup
|
||||||
* for the JBossWorkManagerMBean.
|
* for the JBossWorkManagerMBean.
|
||||||
* @param workManagerObjectName the JMX object name to use
|
* @param mbeanName the JMX object name to use
|
||||||
* @see org.jboss.resource.work.JBossWorkManagerMBean
|
* @see org.jboss.resource.work.JBossWorkManagerMBean
|
||||||
*/
|
*/
|
||||||
public static WorkManager getWorkManager(String mbeanName) {
|
public static WorkManager getWorkManager(String mbeanName) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -157,7 +157,7 @@ public @interface EnableTransactionManagement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicate how transactional advice should be applied. The default is
|
* Indicate how transactional advice should be applied. The default is
|
||||||
* {@link AdviceMode.PROXY}.
|
* {@link AdviceMode#PROXY}.
|
||||||
* @see AdviceMode
|
* @see AdviceMode
|
||||||
*/
|
*/
|
||||||
AdviceMode mode() default AdviceMode.PROXY;
|
AdviceMode mode() default AdviceMode.PROXY;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -156,7 +156,6 @@ public class TransactionProxyFactoryBean extends AbstractSingletonProxyFactoryBe
|
||||||
* @see TransactionAttributeSourceEditor
|
* @see TransactionAttributeSourceEditor
|
||||||
* @see MethodMapTransactionAttributeSource
|
* @see MethodMapTransactionAttributeSource
|
||||||
* @see NameMatchTransactionAttributeSource
|
* @see NameMatchTransactionAttributeSource
|
||||||
* @see AttributesTransactionAttributeSource
|
|
||||||
* @see org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
|
* @see org.springframework.transaction.annotation.AnnotationTransactionAttributeSource
|
||||||
*/
|
*/
|
||||||
public void setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource) {
|
public void setTransactionAttributeSource(TransactionAttributeSource transactionAttributeSource) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public abstract class DelegatingTransactionDefinition implements TransactionDefi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a DelegatingTransactionAttribute for the given target attribute.
|
* Create a DelegatingTransactionAttribute for the given target attribute.
|
||||||
* @param targetAttribute the target TransactionAttribute to delegate to
|
* @param targetDefinition the target TransactionAttribute to delegate to
|
||||||
*/
|
*/
|
||||||
public DelegatingTransactionDefinition(TransactionDefinition targetDefinition) {
|
public DelegatingTransactionDefinition(TransactionDefinition targetDefinition) {
|
||||||
Assert.notNull(targetDefinition, "Target definition must not be null");
|
Assert.notNull(targetDefinition, "Target definition must not be null");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -22,7 +22,7 @@ import org.springframework.http.HttpRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Intercepts client-side HTTP requests. Implementations of this interface can be {@linkplain
|
* Intercepts client-side HTTP requests. Implementations of this interface can be {@linkplain
|
||||||
* org.springframework.web.client.RestTemplate#setInterceptors(ClientHttpRequestInterceptor[]) registered} with the
|
* org.springframework.web.client.RestTemplate#setInterceptors(java.util.List) registered} with the
|
||||||
* {@link org.springframework.web.client.RestTemplate RestTemplate}, as to modify the outgoing {@link ClientHttpRequest}
|
* {@link org.springframework.web.client.RestTemplate RestTemplate}, as to modify the outgoing {@link ClientHttpRequest}
|
||||||
* and/or the incoming {@link ClientHttpResponse}.
|
* and/or the incoming {@link ClientHttpResponse}.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,8 @@ package org.springframework.http.converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown by {@link org.springframework.http.converter.HttpMessageConverter} implementations when the
|
* Thrown by {@link org.springframework.http.converter.HttpMessageConverter} implementations when the
|
||||||
* {@link org.springframework.http.converter.HttpMessageConverter#write(Object, org.springframework.http.HttpOutputMessage) write} method fails.
|
* {@link org.springframework.http.converter.HttpMessageConverter#write(Object, org.springframework.http.MediaType,
|
||||||
|
* org.springframework.http.HttpOutputMessage) write} method fails.
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ import java.lang.annotation.Target;
|
||||||
* @see RequestParam
|
* @see RequestParam
|
||||||
* @see RequestHeader
|
* @see RequestHeader
|
||||||
* @see org.springframework.web.bind.annotation.RequestMapping
|
* @see org.springframework.web.bind.annotation.RequestMapping
|
||||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter
|
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
|
||||||
|
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.PARAMETER)
|
@Target(ElementType.PARAMETER)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -29,7 +29,8 @@ import java.lang.annotation.Target;
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @see RequestMapping
|
* @see RequestMapping
|
||||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter
|
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
|
||||||
|
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.PARAMETER)
|
@Target(ElementType.PARAMETER)
|
||||||
|
|
|
||||||
|
|
@ -25,17 +25,18 @@ import java.lang.annotation.Target;
|
||||||
import org.springframework.http.converter.HttpMessageConverter;
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Annotation indicating a method parameter should be bound to the body of the web request.
|
* Annotation indicating a method parameter should be bound to the body of the web request.
|
||||||
* The body of the request is passed through an {@link HttpMessageConverter} to resolve the
|
* The body of the request is passed through an {@link HttpMessageConverter} to resolve the
|
||||||
* method argument depending on the content type of the request. Optionally, automatic
|
* method argument depending on the content type of the request. Optionally, automatic
|
||||||
* validation can be applied by annotating the argument with {@code @Valid}.
|
* validation can be applied by annotating the argument with {@code @Valid}.
|
||||||
*
|
*
|
||||||
* <p>Supported for annotated handler methods in Servlet environments.
|
* <p>Supported for annotated handler methods in Servlet environments.
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @see RequestHeader
|
* @see RequestHeader
|
||||||
* @see ResponseBody
|
* @see ResponseBody
|
||||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter
|
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
|
||||||
|
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.PARAMETER)
|
@Target(ElementType.PARAMETER)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import java.lang.annotation.Target;
|
||||||
* @see RequestMapping
|
* @see RequestMapping
|
||||||
* @see RequestParam
|
* @see RequestParam
|
||||||
* @see CookieValue
|
* @see CookieValue
|
||||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter
|
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
|
||||||
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.PARAMETER)
|
@Target(ElementType.PARAMETER)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ import java.util.concurrent.Callable;
|
||||||
* As a consequence, such an argument will never be <code>null</code>.
|
* As a consequence, such an argument will never be <code>null</code>.
|
||||||
* <i>Note that session access may not be thread-safe, in particular in a
|
* <i>Note that session access may not be thread-safe, in particular in a
|
||||||
* Servlet environment: Consider switching the
|
* Servlet environment: Consider switching the
|
||||||
* {@link org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter#setSynchronizeOnSession "synchronizeOnSession"}
|
* {@link org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#setSynchronizeOnSession "synchronizeOnSession"}
|
||||||
* flag to "true" if multiple requests are allowed to access a session concurrently.</i>
|
* flag to "true" if multiple requests are allowed to access a session concurrently.</i>
|
||||||
* <li>{@link org.springframework.web.context.request.WebRequest} or
|
* <li>{@link org.springframework.web.context.request.WebRequest} or
|
||||||
* {@link org.springframework.web.context.request.NativeWebRequest}.
|
* {@link org.springframework.web.context.request.NativeWebRequest}.
|
||||||
|
|
@ -242,8 +242,7 @@ import java.util.concurrent.Callable;
|
||||||
* @see SessionAttributes
|
* @see SessionAttributes
|
||||||
* @see InitBinder
|
* @see InitBinder
|
||||||
* @see org.springframework.web.context.request.WebRequest
|
* @see org.springframework.web.context.request.WebRequest
|
||||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodMapping
|
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
|
||||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter
|
|
||||||
* @see org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
|
* @see org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping
|
||||||
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -26,14 +26,15 @@ import java.lang.annotation.Target;
|
||||||
* Annotation which indicates that a method parameter should be bound to a web
|
* Annotation which indicates that a method parameter should be bound to a web
|
||||||
* request parameter. Supported for annotated handler methods in Servlet and
|
* request parameter. Supported for annotated handler methods in Servlet and
|
||||||
* Portlet environments.
|
* Portlet environments.
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
* @see RequestMapping
|
* @see RequestMapping
|
||||||
* @see RequestHeader
|
* @see RequestHeader
|
||||||
* @see CookieValue
|
* @see CookieValue
|
||||||
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter
|
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
|
||||||
|
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.PARAMETER)
|
@Target(ElementType.PARAMETER)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -62,7 +62,7 @@ public class ConfigurableWebBindingInitializer implements WebBindingInitializer
|
||||||
* when accessing an out-of-bounds index.
|
* when accessing an out-of-bounds index.
|
||||||
* <p>Default is "true" on a standard DataBinder. Note that this feature is only supported
|
* <p>Default is "true" on a standard DataBinder. Note that this feature is only supported
|
||||||
* for bean property access (DataBinder's default mode), not for field access.
|
* for bean property access (DataBinder's default mode), not for field access.
|
||||||
* @see #initBeanPropertyAccess()
|
* @see org.springframework.validation.DataBinder#initBeanPropertyAccess()
|
||||||
* @see org.springframework.validation.DataBinder#setAutoGrowNestedPaths
|
* @see org.springframework.validation.DataBinder#setAutoGrowNestedPaths
|
||||||
*/
|
*/
|
||||||
public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) {
|
public void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) {
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ public class ContextLoader {
|
||||||
* ContextLoaderListener} subclass as a {@code <listener>} within {@code web.xml}, as
|
* ContextLoaderListener} subclass as a {@code <listener>} within {@code web.xml}, as
|
||||||
* a no-arg constructor is required.
|
* a no-arg constructor is required.
|
||||||
* <p>The created application context will be registered into the ServletContext under
|
* <p>The created application context will be registered into the ServletContext under
|
||||||
* the attribute name {@link WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE}
|
* the attribute name {@link WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE}
|
||||||
* and subclasses are free to call the {@link #closeWebApplicationContext} method on
|
* and subclasses are free to call the {@link #closeWebApplicationContext} method on
|
||||||
* container shutdown to close the application context.
|
* container shutdown to close the application context.
|
||||||
* @see #ContextLoader(WebApplicationContext)
|
* @see #ContextLoader(WebApplicationContext)
|
||||||
|
|
@ -238,7 +238,7 @@ public class ContextLoader {
|
||||||
* <p>See {@link org.springframework.web.WebApplicationInitializer} for usage examples.
|
* <p>See {@link org.springframework.web.WebApplicationInitializer} for usage examples.
|
||||||
* <p>In any case, the given application context will be registered into the
|
* <p>In any case, the given application context will be registered into the
|
||||||
* ServletContext under the attribute name {@link
|
* ServletContext under the attribute name {@link
|
||||||
* WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and subclasses are
|
* WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and subclasses are
|
||||||
* free to call the {@link #closeWebApplicationContext} method on container shutdown
|
* free to call the {@link #closeWebApplicationContext} method on container shutdown
|
||||||
* to close the application context.
|
* to close the application context.
|
||||||
* @param context the application context to manage
|
* @param context the application context to manage
|
||||||
|
|
@ -325,7 +325,6 @@ public class ContextLoader {
|
||||||
* <p>In addition, {@link #customizeContext} gets called prior to refreshing the
|
* <p>In addition, {@link #customizeContext} gets called prior to refreshing the
|
||||||
* context, allowing subclasses to perform custom modifications to the context.
|
* context, allowing subclasses to perform custom modifications to the context.
|
||||||
* @param sc current servlet context
|
* @param sc current servlet context
|
||||||
* @param parent the parent ApplicationContext to use, or <code>null</code> if none
|
|
||||||
* @return the root WebApplicationContext
|
* @return the root WebApplicationContext
|
||||||
* @see ConfigurableWebApplicationContext
|
* @see ConfigurableWebApplicationContext
|
||||||
*/
|
*/
|
||||||
|
|
@ -343,7 +342,7 @@ public class ContextLoader {
|
||||||
/**
|
/**
|
||||||
* @deprecated as of Spring 3.1 in favor of
|
* @deprecated as of Spring 3.1 in favor of
|
||||||
* {@link #createWebApplicationContext(ServletContext)} and
|
* {@link #createWebApplicationContext(ServletContext)} and
|
||||||
* {@link #configureAndRefreshWebApplicationContext(WebApplicationContext, ServletContext)}
|
* {@link #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext, ServletContext)}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
protected WebApplicationContext createWebApplicationContext(ServletContext sc, ApplicationContext parent) {
|
protected WebApplicationContext createWebApplicationContext(ServletContext sc, ApplicationContext parent) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -52,7 +52,7 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte
|
||||||
* as a {@code <listener>} within {@code web.xml}, where a no-arg constructor is
|
* as a {@code <listener>} within {@code web.xml}, where a no-arg constructor is
|
||||||
* required.
|
* required.
|
||||||
* <p>The created application context will be registered into the ServletContext under
|
* <p>The created application context will be registered into the ServletContext under
|
||||||
* the attribute name {@link WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE}
|
* the attribute name {@link WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE}
|
||||||
* and the Spring application context will be closed when the {@link #contextDestroyed}
|
* and the Spring application context will be closed when the {@link #contextDestroyed}
|
||||||
* lifecycle method is invoked on this listener.
|
* lifecycle method is invoked on this listener.
|
||||||
* @see ContextLoader
|
* @see ContextLoader
|
||||||
|
|
@ -66,21 +66,22 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte
|
||||||
/**
|
/**
|
||||||
* Create a new {@code ContextLoaderListener} with the given application context. This
|
* Create a new {@code ContextLoaderListener} with the given application context. This
|
||||||
* constructor is useful in Servlet 3.0+ environments where instance-based
|
* constructor is useful in Servlet 3.0+ environments where instance-based
|
||||||
* registration of listeners is possible through the {@link ServletContext#addListener}
|
* registration of listeners is possible through the {@link javax.servlet.ServletContext#addListener}
|
||||||
* API.
|
* API.
|
||||||
* <p>The context may or may not yet be {@linkplain
|
* <p>The context may or may not yet be {@linkplain
|
||||||
* ConfigurableApplicationContext#refresh() refreshed}. If it (a) is an implementation
|
* org.springframework.context.ConfigurableApplicationContext#refresh() refreshed}. If it
|
||||||
* of {@link ConfigurableWebApplicationContext} and (b) has <strong>not</strong>
|
* (a) is an implementation of {@link ConfigurableWebApplicationContext} and
|
||||||
* already been refreshed (the recommended approach), then the following will occur:
|
* (b) has <strong>not</strong> already been refreshed (the recommended approach),
|
||||||
|
* then the following will occur:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>If the given context has not already been assigned an {@linkplain
|
* <li>If the given context has not already been assigned an {@linkplain
|
||||||
* ConfigurableApplicationContext#setId id}, one will be assigned to it</li>
|
* org.springframework.context.ConfigurableApplicationContext#setId id}, one will be assigned to it</li>
|
||||||
* <li>{@code ServletContext} and {@code ServletConfig} objects will be delegated to
|
* <li>{@code ServletContext} and {@code ServletConfig} objects will be delegated to
|
||||||
* the application context</li>
|
* the application context</li>
|
||||||
* <li>{@link #customizeContext} will be called</li>
|
* <li>{@link #customizeContext} will be called</li>
|
||||||
* <li>Any {@link ApplicationContextInitializer}s specified through the
|
* <li>Any {@link org.springframework.context.ApplicationContextInitializer ApplicationContextInitializer}s
|
||||||
* "contextInitializerClasses" init-param will be applied.</li>
|
* specified through the "contextInitializerClasses" init-param will be applied.</li>
|
||||||
* <li>{@link ConfigurableApplicationContext#refresh refresh()} will be called</li>
|
* <li>{@link org.springframework.context.ConfigurableApplicationContext#refresh refresh()} will be called</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* If the context has already been refreshed or does not implement
|
* If the context has already been refreshed or does not implement
|
||||||
* {@code ConfigurableWebApplicationContext}, none of the above will occur under the
|
* {@code ConfigurableWebApplicationContext}, none of the above will occur under the
|
||||||
|
|
@ -89,7 +90,7 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte
|
||||||
* <p>See {@link org.springframework.web.WebApplicationInitializer} for usage examples.
|
* <p>See {@link org.springframework.web.WebApplicationInitializer} for usage examples.
|
||||||
* <p>In any case, the given application context will be registered into the
|
* <p>In any case, the given application context will be registered into the
|
||||||
* ServletContext under the attribute name {@link
|
* ServletContext under the attribute name {@link
|
||||||
* WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and the Spring
|
* WebApplicationContext#ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE} and the Spring
|
||||||
* application context will be closed when the {@link #contextDestroyed} lifecycle
|
* application context will be closed when the {@link #contextDestroyed} lifecycle
|
||||||
* method is invoked on this listener.
|
* method is invoked on this listener.
|
||||||
* @param context the application context to manage
|
* @param context the application context to manage
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -137,7 +137,7 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
|
||||||
* <p>Calls to {@link #register} are idempotent; adding the same
|
* <p>Calls to {@link #register} are idempotent; adding the same
|
||||||
* annotated class more than once has no additional effect.
|
* annotated class more than once has no additional effect.
|
||||||
* @param annotatedClasses one or more annotated classes,
|
* @param annotatedClasses one or more annotated classes,
|
||||||
* e.g. {@link Configuration @Configuration} classes
|
* e.g. {@link org.springframework.context.annotation.Configuration @Configuration} classes
|
||||||
* @see #scan(String...)
|
* @see #scan(String...)
|
||||||
* @see #loadBeanDefinitions(DefaultListableBeanFactory)
|
* @see #loadBeanDefinitions(DefaultListableBeanFactory)
|
||||||
* @see #setConfigLocation(String)
|
* @see #setConfigLocation(String)
|
||||||
|
|
@ -179,8 +179,8 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
|
||||||
* annotation.
|
* annotation.
|
||||||
* @see #register(Class...)
|
* @see #register(Class...)
|
||||||
* @see #scan(String...)
|
* @see #scan(String...)
|
||||||
* @see #setConfigLocation()
|
* @see #setConfigLocation(String)
|
||||||
* @see #setConfigLocations()
|
* @see #setConfigLocations(String[])
|
||||||
* @see AnnotatedBeanDefinitionReader
|
* @see AnnotatedBeanDefinitionReader
|
||||||
* @see ClassPathBeanDefinitionScanner
|
* @see ClassPathBeanDefinitionScanner
|
||||||
*/
|
*/
|
||||||
|
|
@ -267,7 +267,7 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the {@link ScopeMetadataResolver} to use for detected bean classes.
|
* Set the {@link ScopeMetadataResolver} to use for detected bean classes.
|
||||||
* <p>The default is an {@link AnnotationScopeMetadataResolver}.
|
* <p>The default is an {@link org.springframework.context.annotation.AnnotationScopeMetadataResolver}.
|
||||||
*/
|
*/
|
||||||
public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver) {
|
public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver) {
|
||||||
this.scopeMetadataResolver = scopeMetadataResolver;
|
this.scopeMetadataResolver = scopeMetadataResolver;
|
||||||
|
|
|
||||||
|
|
@ -963,7 +963,6 @@ public class DispatcherPortlet extends FrameworkPortlet {
|
||||||
* Return the HandlerExecutionChain for this request.
|
* Return the HandlerExecutionChain for this request.
|
||||||
* Try all handler mappings in order.
|
* Try all handler mappings in order.
|
||||||
* @param request current portlet request
|
* @param request current portlet request
|
||||||
* @param cache whether to cache the HandlerExecutionChain in a request attribute
|
|
||||||
* @return the HandlerExceutionChain, or null if no handler could be found
|
* @return the HandlerExceutionChain, or null if no handler could be found
|
||||||
*/
|
*/
|
||||||
protected HandlerExecutionChain getHandler(PortletRequest request) throws Exception {
|
protected HandlerExecutionChain getHandler(PortletRequest request) throws Exception {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ public abstract class AbstractRefreshablePortletApplicationContext extends Abstr
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
* <p>The parent {@linkplain #getEnvironment() environment} is
|
* <p>The parent {@linkplain #getEnvironment() environment} is
|
||||||
* delegated to this (child) context if the parent is a
|
* delegated to this (child) context if the parent is a
|
||||||
* {@link ConfigurableApplicationContext} implementation.
|
* {@link org.springframework.context.ConfigurableApplicationContext} implementation.
|
||||||
* <p>The parent {@linkplain #getServletContext() servlet context} is
|
* <p>The parent {@linkplain #getServletContext() servlet context} is
|
||||||
* delegated to this (child) context if the parent is a {@link WebApplicationContext}
|
* delegated to this (child) context if the parent is a {@link WebApplicationContext}
|
||||||
* implementation.
|
* implementation.
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public class PortletContextScope implements Scope, DisposableBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Scope wrapper for the given PortletContext.
|
* Create a new Scope wrapper for the given PortletContext.
|
||||||
* @param PortletContext the PortletContext to wrap
|
* @param portletContext the PortletContext to wrap
|
||||||
*/
|
*/
|
||||||
public PortletContextScope(PortletContext portletContext) {
|
public PortletContextScope(PortletContext portletContext) {
|
||||||
Assert.notNull(portletContext, "PortletContext must not be null");
|
Assert.notNull(portletContext, "PortletContext must not be null");
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
* <p>The parent {@linkplain #getEnvironment() environment} is
|
* <p>The parent {@linkplain #getEnvironment() environment} is
|
||||||
* delegated to this (child) context if the parent is a
|
* delegated to this (child) context if the parent is a
|
||||||
* {@link ConfigurableApplicationContext} implementation.
|
* {@link org.springframework.context.ConfigurableApplicationContext} implementation.
|
||||||
* <p>The parent {@linkplain #getServletContext() servlet context} is
|
* <p>The parent {@linkplain #getServletContext() servlet context} is
|
||||||
* delegated to this (child) context if the parent is a {@link WebApplicationContext}
|
* delegated to this (child) context if the parent is a {@link WebApplicationContext}
|
||||||
* implementation.
|
* implementation.
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ public class PortletRequestMethodNotSupportedException extends PortletException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new PortletRequestMethodNotSupportedException.
|
* Create a new PortletRequestMethodNotSupportedException.
|
||||||
* @param method the unsupported HTTP request method
|
|
||||||
* @param supportedMethods the actually supported HTTP methods
|
* @param supportedMethods the actually supported HTTP methods
|
||||||
*/
|
*/
|
||||||
public PortletRequestMethodNotSupportedException(String[] supportedMethods) {
|
public PortletRequestMethodNotSupportedException(String[] supportedMethods) {
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ public abstract class FrameworkServlet extends HttpServletBean {
|
||||||
* Specify the set of fully-qualified {@link ApplicationContextInitializer} class
|
* Specify the set of fully-qualified {@link ApplicationContextInitializer} class
|
||||||
* names, per the optional "contextInitializerClasses" servlet init-param.
|
* names, per the optional "contextInitializerClasses" servlet init-param.
|
||||||
* @see #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext)
|
* @see #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext)
|
||||||
* @see #applyInitializers(ConfigurableWebApplicationContext)
|
* @see #applyInitializers(ConfigurableApplicationContext)
|
||||||
*/
|
*/
|
||||||
public void setContextInitializerClasses(String contextInitializerClasses) {
|
public void setContextInitializerClasses(String contextInitializerClasses) {
|
||||||
this.contextInitializerClasses = contextInitializerClasses;
|
this.contextInitializerClasses = contextInitializerClasses;
|
||||||
|
|
@ -340,7 +340,7 @@ public abstract class FrameworkServlet extends HttpServletBean {
|
||||||
* Specify which {@link ApplicationContextInitializer} instances should be used
|
* Specify which {@link ApplicationContextInitializer} instances should be used
|
||||||
* to initialize the application context used by this {@code FrameworkServlet}.
|
* to initialize the application context used by this {@code FrameworkServlet}.
|
||||||
* @see #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext)
|
* @see #configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext)
|
||||||
* @see #applyInitializers(ConfigurableWebApplicationContext)
|
* @see #applyInitializers(ConfigurableApplicationContext)
|
||||||
*/
|
*/
|
||||||
public void setContextInitializers(ApplicationContextInitializer<ConfigurableApplicationContext>... contextInitializers) {
|
public void setContextInitializers(ApplicationContextInitializer<ConfigurableApplicationContext>... contextInitializers) {
|
||||||
for (ApplicationContextInitializer<ConfigurableApplicationContext> initializer : contextInitializers) {
|
for (ApplicationContextInitializer<ConfigurableApplicationContext> initializer : contextInitializers) {
|
||||||
|
|
@ -691,12 +691,12 @@ public abstract class FrameworkServlet extends HttpServletBean {
|
||||||
* <p>The default implementation is empty. <code>refresh()</code> will
|
* <p>The default implementation is empty. <code>refresh()</code> will
|
||||||
* be called automatically after this method returns.
|
* be called automatically after this method returns.
|
||||||
* <p>Note that this method is designed to allow subclasses to modify the application
|
* <p>Note that this method is designed to allow subclasses to modify the application
|
||||||
* context, while {@link #initializeWebApplicationContext} is designed to allow
|
* context, while {@link #initWebApplicationContext} is designed to allow
|
||||||
* end-users to modify the context through the use of
|
* end-users to modify the context through the use of
|
||||||
* {@link ApplicationContextInitializer}s.
|
* {@link ApplicationContextInitializer}s.
|
||||||
* @param wac the configured WebApplicationContext (not refreshed yet)
|
* @param wac the configured WebApplicationContext (not refreshed yet)
|
||||||
* @see #createWebApplicationContext
|
* @see #createWebApplicationContext
|
||||||
* @see #initializeWebApplicationContext
|
* @see #initWebApplicationContext
|
||||||
* @see ConfigurableWebApplicationContext#refresh()
|
* @see ConfigurableWebApplicationContext#refresh()
|
||||||
*/
|
*/
|
||||||
protected void postProcessWebApplicationContext(ConfigurableWebApplicationContext wac) {
|
protected void postProcessWebApplicationContext(ConfigurableWebApplicationContext wac) {
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class DispatcherServletWebRequest extends ServletWebRequest {
|
||||||
/**
|
/**
|
||||||
* Create a new DispatcherServletWebRequest instance for the given request and response.
|
* Create a new DispatcherServletWebRequest instance for the given request and response.
|
||||||
* @param request current HTTP request
|
* @param request current HTTP request
|
||||||
* @param request current HTTP response
|
* @param response current HTTP response
|
||||||
*/
|
*/
|
||||||
public DispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response) {
|
public DispatcherServletWebRequest(HttpServletRequest request, HttpServletResponse response) {
|
||||||
super(request, response);
|
super(request, response);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -443,7 +443,7 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator
|
||||||
/**
|
/**
|
||||||
* This method always returns -1 since an annotated controller can have many methods,
|
* This method always returns -1 since an annotated controller can have many methods,
|
||||||
* each requiring separate lastModified calculations. Instead, an
|
* each requiring separate lastModified calculations. Instead, an
|
||||||
* @{@link RequestMapping}-annotated method can calculate the lastModified value, call
|
* {@link RequestMapping}-annotated method can calculate the lastModified value, call
|
||||||
* {@link org.springframework.web.context.request.WebRequest#checkNotModified(long)}
|
* {@link org.springframework.web.context.request.WebRequest#checkNotModified(long)}
|
||||||
* to check it, and return {@code null} if that returns {@code true}.
|
* to check it, and return {@code null} if that returns {@code true}.
|
||||||
* @see org.springframework.web.context.request.WebRequest#checkNotModified(long)
|
* @see org.springframework.web.context.request.WebRequest#checkNotModified(long)
|
||||||
|
|
@ -483,7 +483,7 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator
|
||||||
* @return the ServletRequestDataBinder instance to use
|
* @return the ServletRequestDataBinder instance to use
|
||||||
* @throws Exception in case of invalid state or arguments
|
* @throws Exception in case of invalid state or arguments
|
||||||
* @see ServletRequestDataBinder#bind(javax.servlet.ServletRequest)
|
* @see ServletRequestDataBinder#bind(javax.servlet.ServletRequest)
|
||||||
* @see ServletRequestDataBinder#convertIfNecessary(Object, Class, org.springframework.core.MethodParameter)
|
* @see ServletRequestDataBinder#convertIfNecessary(Object, Class, org.springframework.core.MethodParameter)
|
||||||
*/
|
*/
|
||||||
protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object target, String objectName) throws Exception {
|
protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object target, String objectName) throws Exception {
|
||||||
return new ServletRequestDataBinder(target, objectName);
|
return new ServletRequestDataBinder(target, objectName);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -22,15 +22,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The contract for request conditions.
|
* The contract for request conditions.
|
||||||
*
|
*
|
||||||
* <p>Request conditions can be combined via {@link #combine(Object)}, matched to
|
* <p>Request conditions can be combined via {@link #combine(Object)}, matched to
|
||||||
* a request via {@link #getMatchingCondition(HttpServletRequest)}, and compared
|
* a request via {@link #getMatchingCondition(HttpServletRequest)}, and compared
|
||||||
* to each other via {@link #compareTo(Object, HttpServletRequest)} to determine
|
* to each other via {@link #compareTo(Object, HttpServletRequest)} to determine
|
||||||
* which matches a request more closely.
|
* which matches a request more closely.
|
||||||
*
|
*
|
||||||
* @param <T> The type of objects that this RequestCondition can be combined
|
* @param <T> The type of objects that this RequestCondition can be combined
|
||||||
* with compared to.
|
* with compared to.
|
||||||
*
|
*
|
||||||
* @author Rossen Stoyanchev
|
* @author Rossen Stoyanchev
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
|
|
@ -38,32 +38,32 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
public interface RequestCondition<T> {
|
public interface RequestCondition<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the rules for combining this condition (i.e. the current instance)
|
* Defines the rules for combining this condition (i.e. the current instance)
|
||||||
* with another condition. For example combining type- and method-level
|
* with another condition. For example combining type- and method-level
|
||||||
* {@link RequestMapping} conditions.
|
* {@link RequestMapping} conditions.
|
||||||
*
|
*
|
||||||
* @param other the condition to combine with.
|
* @param other the condition to combine with.
|
||||||
* @returns a request condition instance that is the result of combining
|
* @return a request condition instance that is the result of combining
|
||||||
* the two condition instances.
|
* the two condition instances.
|
||||||
*/
|
*/
|
||||||
T combine(T other);
|
T combine(T other);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this condition matches the given request and returns a
|
* Checks if this condition matches the given request and returns a
|
||||||
* potentially new request condition with content tailored to the
|
* potentially new request condition with content tailored to the
|
||||||
* current request. For example a condition with URL patterns might
|
* current request. For example a condition with URL patterns might
|
||||||
* return a new condition that contains matching patterns sorted
|
* return a new condition that contains matching patterns sorted
|
||||||
* with best matching patterns on top.
|
* with best matching patterns on top.
|
||||||
*
|
*
|
||||||
* @return a condition instance in case of a match;
|
* @return a condition instance in case of a match;
|
||||||
* or {@code null} if there is no match.
|
* or {@code null} if there is no match.
|
||||||
*/
|
*/
|
||||||
T getMatchingCondition(HttpServletRequest request);
|
T getMatchingCondition(HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this condition to another condition in the context of
|
* Compares this condition to another condition in the context of
|
||||||
* a specific request. This method assumes both instances have
|
* a specific request. This method assumes both instances have
|
||||||
* been obtained via {@link #getMatchingCondition(HttpServletRequest)}
|
* been obtained via {@link #getMatchingCondition(HttpServletRequest)}
|
||||||
* to ensure they have content relevant to current request only.
|
* to ensure they have content relevant to current request only.
|
||||||
*/
|
*/
|
||||||
int compareTo(T other, HttpServletRequest request);
|
int compareTo(T other, HttpServletRequest request);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -54,10 +54,10 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the given RequestMappingInfo matches the current request and
|
* Check if the given RequestMappingInfo matches the current request and
|
||||||
* return a (potentially new) instance with conditions that match the
|
* return a (potentially new) instance with conditions that match the
|
||||||
* current request -- for example with a subset of URL patterns.
|
* current request -- for example with a subset of URL patterns.
|
||||||
* @returns an info in case of a match; or {@code null} otherwise.
|
* @return an info in case of a match; or {@code null} otherwise.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected RequestMappingInfo getMatchingMapping(RequestMappingInfo info, HttpServletRequest request) {
|
protected RequestMappingInfo getMatchingMapping(RequestMappingInfo info, HttpServletRequest request) {
|
||||||
|
|
@ -101,17 +101,17 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
|
||||||
/**
|
/**
|
||||||
* Iterate all RequestMappingInfos once again, look if any match by URL at
|
* Iterate all RequestMappingInfos once again, look if any match by URL at
|
||||||
* least and raise exceptions accordingly.
|
* least and raise exceptions accordingly.
|
||||||
*
|
*
|
||||||
* @throws HttpRequestMethodNotSupportedException
|
* @throws HttpRequestMethodNotSupportedException
|
||||||
* if there are matches by URL but not by HTTP method
|
* if there are matches by URL but not by HTTP method
|
||||||
* @throws HttpMediaTypeNotAcceptableException
|
* @throws HttpMediaTypeNotAcceptableException
|
||||||
* if there are matches by URL but not by consumable media types
|
* if there are matches by URL but not by consumable media types
|
||||||
* @throws HttpMediaTypeNotAcceptableException
|
* @throws HttpMediaTypeNotAcceptableException
|
||||||
* if there are matches by URL but not by producible media types
|
* if there are matches by URL but not by producible media types
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> requestMappingInfos,
|
protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> requestMappingInfos,
|
||||||
String lookupPath,
|
String lookupPath,
|
||||||
HttpServletRequest request) throws ServletException {
|
HttpServletRequest request) throws ServletException {
|
||||||
Set<String> allowedMethods = new HashSet<String>(6);
|
Set<String> allowedMethods = new HashSet<String>(6);
|
||||||
Set<MediaType> consumableMediaTypes = new HashSet<MediaType>();
|
Set<MediaType> consumableMediaTypes = new HashSet<MediaType>();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -32,8 +32,8 @@ import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
|
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates {@link RequestMappingInfo} instances from type and method-level
|
* Creates {@link RequestMappingInfo} instances from type and method-level
|
||||||
* {@link RequestMapping @RequestMapping} annotations in
|
* {@link RequestMapping @RequestMapping} annotations in
|
||||||
* {@link Controller @Controller} classes.
|
* {@link Controller @Controller} classes.
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
|
|
@ -49,7 +49,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
||||||
/**
|
/**
|
||||||
* Whether to use suffix pattern match (".*") when matching patterns to
|
* Whether to use suffix pattern match (".*") when matching patterns to
|
||||||
* requests. If enabled a method mapped to "/users" also matches to "/users.*".
|
* requests. If enabled a method mapped to "/users" also matches to "/users.*".
|
||||||
* <p>The default value is {@code true}.
|
* <p>The default value is {@code true}.
|
||||||
*/
|
*/
|
||||||
public void setUseSuffixPatternMatch(boolean useSuffixPatternMatch) {
|
public void setUseSuffixPatternMatch(boolean useSuffixPatternMatch) {
|
||||||
this.useSuffixPatternMatch = useSuffixPatternMatch;
|
this.useSuffixPatternMatch = useSuffixPatternMatch;
|
||||||
|
|
@ -78,7 +78,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
* Expects a handler to have a type-level @{@link Controller} annotation.
|
* Expects a handler to have a type-level @{@link Controller} annotation.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -89,10 +89,10 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
||||||
/**
|
/**
|
||||||
* Uses method and type-level @{@link RequestMapping} annotations to create
|
* Uses method and type-level @{@link RequestMapping} annotations to create
|
||||||
* the RequestMappingInfo.
|
* the RequestMappingInfo.
|
||||||
*
|
*
|
||||||
* @return the created RequestMappingInfo, or {@code null} if the method
|
* @return the created RequestMappingInfo, or {@code null} if the method
|
||||||
* does not have a {@code @RequestMapping} annotation.
|
* does not have a {@code @RequestMapping} annotation.
|
||||||
*
|
*
|
||||||
* @see #getCustomMethodCondition(Method)
|
* @see #getCustomMethodCondition(Method)
|
||||||
* @see #getCustomTypeCondition(Class)
|
* @see #getCustomTypeCondition(Class)
|
||||||
*/
|
*/
|
||||||
|
|
@ -114,9 +114,9 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide a custom method-level request condition.
|
* Provide a custom method-level request condition.
|
||||||
* The custom {@link RequestCondition} can be of any type so long as the
|
* The custom {@link RequestCondition} can be of any type so long as the
|
||||||
* same condition type is returned from all calls to this method in order
|
* same condition type is returned from all calls to this method in order
|
||||||
* to ensure custom request conditions can be combined and compared.
|
* to ensure custom request conditions can be combined and compared.
|
||||||
* @param method the handler method for which to create the condition
|
* @param method the handler method for which to create the condition
|
||||||
* @return the condition, or {@code null}
|
* @return the condition, or {@code null}
|
||||||
*/
|
*/
|
||||||
|
|
@ -126,10 +126,10 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide a custom type-level request condition.
|
* Provide a custom type-level request condition.
|
||||||
* The custom {@link RequestCondition} can be of any type so long as the
|
* The custom {@link RequestCondition} can be of any type so long as the
|
||||||
* same condition type is returned from all calls to this method in order
|
* same condition type is returned from all calls to this method in order
|
||||||
* to ensure custom request conditions can be combined and compared.
|
* to ensure custom request conditions can be combined and compared.
|
||||||
* @param method the handler method for which to create the condition
|
* @param handlerType the handler type for which to create the condition
|
||||||
* @return the condition, or {@code null}
|
* @return the condition, or {@code null}
|
||||||
*/
|
*/
|
||||||
protected RequestCondition<?> getCustomTypeCondition(Class<?> handlerType) {
|
protected RequestCondition<?> getCustomTypeCondition(Class<?> handlerType) {
|
||||||
|
|
@ -141,13 +141,13 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
||||||
*/
|
*/
|
||||||
private RequestMappingInfo createRequestMappingInfo(RequestMapping annotation, RequestCondition<?> customCondition) {
|
private RequestMappingInfo createRequestMappingInfo(RequestMapping annotation, RequestCondition<?> customCondition) {
|
||||||
return new RequestMappingInfo(
|
return new RequestMappingInfo(
|
||||||
new PatternsRequestCondition(annotation.value(),
|
new PatternsRequestCondition(annotation.value(),
|
||||||
getUrlPathHelper(), getPathMatcher(), this.useSuffixPatternMatch, this.useTrailingSlashMatch),
|
getUrlPathHelper(), getPathMatcher(), this.useSuffixPatternMatch, this.useTrailingSlashMatch),
|
||||||
new RequestMethodsRequestCondition(annotation.method()),
|
new RequestMethodsRequestCondition(annotation.method()),
|
||||||
new ParamsRequestCondition(annotation.params()),
|
new ParamsRequestCondition(annotation.params()),
|
||||||
new HeadersRequestCondition(annotation.headers()),
|
new HeadersRequestCondition(annotation.headers()),
|
||||||
new ConsumesRequestCondition(annotation.consumes(), annotation.headers()),
|
new ConsumesRequestCondition(annotation.consumes(), annotation.headers()),
|
||||||
new ProducesRequestCondition(annotation.produces(), annotation.headers()),
|
new ProducesRequestCondition(annotation.produces(), annotation.headers()),
|
||||||
customCondition);
|
customCondition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2011 the original author or authors.
|
* Copyright 2002-2012 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -37,8 +37,8 @@ import org.springframework.web.servlet.HandlerMapping;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Servlet-specific {@link org.springframework.web.method.annotation.ModelAttributeMethodProcessor} that applies data
|
* A Servlet-specific {@link org.springframework.web.method.annotation.ModelAttributeMethodProcessor} that applies data
|
||||||
* binding through a WebDataBinder of type {@link ServletRequestDataBinder}.
|
* binding through a WebDataBinder of type {@link ServletRequestDataBinder}.
|
||||||
*
|
*
|
||||||
* <p>Also adds a fall-back strategy to instantiate the model attribute from a
|
* <p>Also adds a fall-back strategy to instantiate the model attribute from a
|
||||||
* URI template variable or from a request parameter if the name matches the
|
* URI template variable or from a request parameter if the name matches the
|
||||||
* model attribute name and there is an appropriate type conversion strategy.
|
* model attribute name and there is an appropriate type conversion strategy.
|
||||||
|
|
@ -50,7 +50,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param annotationNotRequired if "true", non-simple method arguments and
|
* @param annotationNotRequired if "true", non-simple method arguments and
|
||||||
* return values are considered model attributes with or without a
|
* return values are considered model attributes with or without a
|
||||||
* {@code @ModelAttribute} annotation.
|
* {@code @ModelAttribute} annotation.
|
||||||
*/
|
*/
|
||||||
public ServletModelAttributeMethodProcessor(boolean annotationNotRequired) {
|
public ServletModelAttributeMethodProcessor(boolean annotationNotRequired) {
|
||||||
|
|
@ -62,12 +62,12 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
|
||||||
* request parameter if the name matches to the model attribute name and
|
* request parameter if the name matches to the model attribute name and
|
||||||
* if there is an appropriate type conversion strategy. If none of these
|
* if there is an appropriate type conversion strategy. If none of these
|
||||||
* are true delegate back to the base class.
|
* are true delegate back to the base class.
|
||||||
* @see #createAttributeFromUriValue
|
* @see #createAttributeFromRequestValue(String, String, MethodParameter, WebDataBinderFactory, NativeWebRequest)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected final Object createAttribute(String attributeName,
|
protected final Object createAttribute(String attributeName,
|
||||||
MethodParameter parameter,
|
MethodParameter parameter,
|
||||||
WebDataBinderFactory binderFactory,
|
WebDataBinderFactory binderFactory,
|
||||||
NativeWebRequest request) throws Exception {
|
NativeWebRequest request) throws Exception {
|
||||||
|
|
||||||
String value = getRequestValueForAttribute(attributeName, request);
|
String value = getRequestValueForAttribute(attributeName, request);
|
||||||
|
|
@ -83,7 +83,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a value from the request that may be used to instantiate the
|
* Obtain a value from the request that may be used to instantiate the
|
||||||
* model attribute through type conversion from String to the target type.
|
* model attribute through type conversion from String to the target type.
|
||||||
* <p>The default implementation looks for the attribute name to match
|
* <p>The default implementation looks for the attribute name to match
|
||||||
* a URI variable first and then a request parameter.
|
* a URI variable first and then a request parameter.
|
||||||
* @param attributeName the model attribute name
|
* @param attributeName the model attribute name
|
||||||
|
|
@ -105,7 +105,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected final Map<String, String> getUriTemplateVariables(NativeWebRequest request) {
|
protected final Map<String, String> getUriTemplateVariables(NativeWebRequest request) {
|
||||||
Map<String, String> variables =
|
Map<String, String> variables =
|
||||||
(Map<String, String>) request.getAttribute(
|
(Map<String, String>) request.getAttribute(
|
||||||
HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
|
HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
|
||||||
return (variables != null) ? variables : Collections.<String, String>emptyMap();
|
return (variables != null) ? variables : Collections.<String, String>emptyMap();
|
||||||
|
|
@ -114,7 +114,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
|
||||||
/**
|
/**
|
||||||
* Create a model attribute from a String request value (e.g. URI template
|
* Create a model attribute from a String request value (e.g. URI template
|
||||||
* variable, request parameter) using type conversion.
|
* variable, request parameter) using type conversion.
|
||||||
* <p>The default implementation converts only if there a registered
|
* <p>The default implementation converts only if there a registered
|
||||||
* {@link Converter} that can perform the conversion.
|
* {@link Converter} that can perform the conversion.
|
||||||
* @param sourceValue the source value to create the model attribute from
|
* @param sourceValue the source value to create the model attribute from
|
||||||
* @param attributeName the name of the attribute, never {@code null}
|
* @param attributeName the name of the attribute, never {@code null}
|
||||||
|
|
@ -125,9 +125,9 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected Object createAttributeFromRequestValue(String sourceValue,
|
protected Object createAttributeFromRequestValue(String sourceValue,
|
||||||
String attributeName,
|
String attributeName,
|
||||||
MethodParameter parameter,
|
MethodParameter parameter,
|
||||||
WebDataBinderFactory binderFactory,
|
WebDataBinderFactory binderFactory,
|
||||||
NativeWebRequest request) throws Exception {
|
NativeWebRequest request) throws Exception {
|
||||||
DataBinder binder = binderFactory.createBinder(request, null, attributeName);
|
DataBinder binder = binderFactory.createBinder(request, null, attributeName);
|
||||||
ConversionService conversionService = binder.getConversionService();
|
ConversionService conversionService = binder.getConversionService();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,8 @@ import org.springframework.web.context.ServletContextAware;
|
||||||
/**
|
/**
|
||||||
* An {@link HttpRequestHandler} for serving static files using the Servlet container's "default" Servlet.
|
* An {@link HttpRequestHandler} for serving static files using the Servlet container's "default" Servlet.
|
||||||
*
|
*
|
||||||
* <p>This handler is intended to be used with a "/*" mapping when the {@link DispatcherServlet}
|
* <p>This handler is intended to be used with a "/*" mapping when the
|
||||||
|
* {@link org.springframework.web.servlet.DispatcherServlet DispatcherServlet}
|
||||||
* is mapped to "/", thus overriding the Servlet container's default handling of static resources.
|
* is mapped to "/", thus overriding the Servlet container's default handling of static resources.
|
||||||
* The mapping to this handler should generally be ordered as the last in the chain so that it will
|
* The mapping to this handler should generally be ordered as the last in the chain so that it will
|
||||||
* only execute when no other more specific mappings (i.e., to controllers) can be matched.
|
* only execute when no other more specific mappings (i.e., to controllers) can be matched.
|
||||||
|
|
|
||||||
|
|
@ -50,16 +50,16 @@ import org.springframework.web.util.WebUtils;
|
||||||
/**
|
/**
|
||||||
* Context holder for request-specific state, like current web application context, current locale, current theme, and
|
* Context holder for request-specific state, like current web application context, current locale, current theme, and
|
||||||
* potential binding errors. Provides easy access to localized messages and Errors instances.
|
* potential binding errors. Provides easy access to localized messages and Errors instances.
|
||||||
*
|
*
|
||||||
* <p>Suitable for exposition to views, and usage within JSP's "useBean" tag, JSP scriptlets, JSTL EL, Velocity
|
* <p>Suitable for exposition to views, and usage within JSP's "useBean" tag, JSP scriptlets, JSTL EL, Velocity
|
||||||
* templates, etc. Necessary for views that do not have access to the servlet request, like Velocity templates.
|
* templates, etc. Necessary for views that do not have access to the servlet request, like Velocity templates.
|
||||||
*
|
*
|
||||||
* <p>Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's
|
* <p>Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's
|
||||||
* "requestContextAttribute" property.
|
* "requestContextAttribute" property.
|
||||||
*
|
*
|
||||||
* <p>Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext and using an
|
* <p>Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext and using an
|
||||||
* appropriate fallback for the locale (the HttpServletRequest's primary locale).
|
* appropriate fallback for the locale (the HttpServletRequest's primary locale).
|
||||||
*
|
*
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
* @since 03.03.2003
|
* @since 03.03.2003
|
||||||
* @see org.springframework.web.servlet.DispatcherServlet
|
* @see org.springframework.web.servlet.DispatcherServlet
|
||||||
|
|
@ -83,8 +83,8 @@ public class RequestContext {
|
||||||
public static final String WEB_APPLICATION_CONTEXT_ATTRIBUTE = RequestContext.class.getName() + ".CONTEXT";
|
public static final String WEB_APPLICATION_CONTEXT_ATTRIBUTE = RequestContext.class.getName() + ".CONTEXT";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the bean to use to look up in an implementation of
|
* The name of the bean to use to look up in an implementation of
|
||||||
* {@link RequestDataValueProcessor} has been configured.
|
* {@link RequestDataValueProcessor} has been configured.
|
||||||
*/
|
*/
|
||||||
private static final String REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME = "requestDataValueProcessor";
|
private static final String REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME = "requestDataValueProcessor";
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ public class RequestContext {
|
||||||
* @param model the model attributes for the current view (can be <code>null</code>, using the request attributes
|
* @param model the model attributes for the current view (can be <code>null</code>, using the request attributes
|
||||||
* for Errors retrieval)
|
* for Errors retrieval)
|
||||||
* @see org.springframework.web.servlet.DispatcherServlet
|
* @see org.springframework.web.servlet.DispatcherServlet
|
||||||
* @see #RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext, Map)
|
* @see #RequestContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletContext, Map)
|
||||||
*/
|
*/
|
||||||
public RequestContext(HttpServletRequest request, Map<String, Object> model) {
|
public RequestContext(HttpServletRequest request, Map<String, Object> model) {
|
||||||
initContext(request, null, null, model);
|
initContext(request, null, null, model);
|
||||||
|
|
@ -226,7 +226,7 @@ public class RequestContext {
|
||||||
try {
|
try {
|
||||||
this.requestDataValueProcessor = this.webApplicationContext.getBean(
|
this.requestDataValueProcessor = this.webApplicationContext.getBean(
|
||||||
REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME, RequestDataValueProcessor.class);
|
REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME, RequestDataValueProcessor.class);
|
||||||
}
|
}
|
||||||
catch (NoSuchBeanDefinitionException ex) {
|
catch (NoSuchBeanDefinitionException ex) {
|
||||||
// Ignored
|
// Ignored
|
||||||
}
|
}
|
||||||
|
|
@ -366,7 +366,7 @@ public class RequestContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the RequestDataValueProcessor instance to use obtained from the
|
* Return the RequestDataValueProcessor instance to use obtained from the
|
||||||
* WebApplicationContext under the name {@code "requestDataValueProcessor"}.
|
* WebApplicationContext under the name {@code "requestDataValueProcessor"}.
|
||||||
* Or {@code null} if no matching bean was found.
|
* Or {@code null} if no matching bean was found.
|
||||||
*/
|
*/
|
||||||
|
|
@ -402,9 +402,9 @@ public class RequestContext {
|
||||||
* Return a context-aware URl for the given relative URL with placeholders (named keys with braces <code>{}</code>).
|
* Return a context-aware URl for the given relative URL with placeholders (named keys with braces <code>{}</code>).
|
||||||
* For example, send in a relative URL <code>foo/{bar}?spam={spam}</code> and a parameter map
|
* For example, send in a relative URL <code>foo/{bar}?spam={spam}</code> and a parameter map
|
||||||
* <code>{bar=baz,spam=nuts}</code> and the result will be <code>[contextpath]/foo/baz?spam=nuts</code>.
|
* <code>{bar=baz,spam=nuts}</code> and the result will be <code>[contextpath]/foo/baz?spam=nuts</code>.
|
||||||
*
|
*
|
||||||
* @param relativeUrl the relative URL part
|
* @param relativeUrl the relative URL part
|
||||||
* @param a map of parameters to insert as placeholders in the url
|
* @param params a map of parameters to insert as placeholders in the url
|
||||||
* @return a URL that points back to the server with an absolute path (also URL-encoded accordingly)
|
* @return a URL that points back to the server with an absolute path (also URL-encoded accordingly)
|
||||||
*/
|
*/
|
||||||
public String getContextUrl(String relativeUrl, Map<String, ?> params) {
|
public String getContextUrl(String relativeUrl, Map<String, ?> params) {
|
||||||
|
|
@ -418,9 +418,9 @@ public class RequestContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the path to URL mappings within the current servlet including the
|
* Return the path to URL mappings within the current servlet including the
|
||||||
* context path and the servlet path of the original request. This is useful
|
* context path and the servlet path of the original request. This is useful
|
||||||
* for building links to other resources within the application where a
|
* for building links to other resources within the application where a
|
||||||
* servlet mapping of the style {@code "/main/*"} is used.
|
* servlet mapping of the style {@code "/main/*"} is used.
|
||||||
* <p>Delegates to the UrlPathHelper for decoding the context path.
|
* <p>Delegates to the UrlPathHelper for decoding the context path.
|
||||||
* @see javax.servlet.http.HttpServletRequest#getContextPath
|
* @see javax.servlet.http.HttpServletRequest#getContextPath
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue