Go to file
Sam Brannen d40a35ba5c Support implicit attribute aliases with @AliasFor
Spring Framework 4.2 introduced support for aliases between annotation
attributes that fall into the following two categories.

1) Alias pairs: two attributes in the same annotation that use
   @AliasFor to declare that they are explicit aliases for each other.
2) Meta-annotation attribute overrides: an attribute in one annotation
   uses @AliasFor to declare that it is an explicit override of an
   attribute in a meta-annotation.

However, the existing functionality fails to support the case where two
attributes in the same annotation both use @AliasFor to declare that
they are both explicit overrides of the same attribute in the same
meta-annotation. In such scenarios, one would intuitively assume that
two such attributes would be treated as "implicit" aliases for each
other, analogous to the existing support for explicit alias pairs.
Furthermore, an annotation may potentially declare multiple aliases
that are effectively a set of implicit aliases for each other.

This commit introduces support for implicit aliases configured via
@AliasFor through an extensive overhaul of the support for alias
lookups, validation, etc. Specifically, this commit includes the
following.

- Introduced isAnnotationMetaPresent() in AnnotationUtils.

- Introduced private AliasDescriptor class in AnnotationUtils in order
  to encapsulate the parsing, validation, and comparison of both
  explicit and implicit aliases configured via @AliasFor.

- Switched from single values for alias names to lists of alias names.

- Renamed getAliasedAttributeName() to getAliasedAttributeNames() in
  AnnotationUtils.

- Converted alias map to contain lists of aliases in AnnotationUtils.

- Refactored the following to support multiple implicit aliases:
  getRequiredAttributeWithAlias() in AnnotationAttributes,
  AbstractAliasAwareAnnotationAttributeExtractor,
  MapAnnotationAttributeExtractor, MergedAnnotationAttributesProcessor
  in AnnotatedElementUtils, and postProcessAnnotationAttributes() in
  AnnotationUtils.

- Introduced numerous tests for implicit alias support, including
  AbstractAliasAwareAnnotationAttributeExtractorTestCase,
  DefaultAnnotationAttributeExtractorTests, and
  MapAnnotationAttributeExtractorTests.

- Updated Javadoc in @AliasFor regarding implicit aliases and in
  AnnotationUtils regarding "meta-present".

Issue: SPR-13345
2015-08-28 18:56:17 +02:00
.settings/gradle Remove spring-asm and inline ASM 4 into spring-core 2012-08-10 00:36:49 +02:00
buildSrc/src/main Fix maven dependency scope conflicts in MergePlugin 2015-05-11 20:42:24 +02:00
gradle Upgrade to Gradle 2.5 2015-07-09 17:18:56 +03:00
spring-aop/src Fix default value of CommonsPool2TargetSource#maxWait 2015-08-14 16:34:32 +02:00
spring-aspects Polishing 2015-07-21 22:58:34 +02:00
spring-beans/src BeanWrapperImpl.getPropertyDescriptor allows for nested paths again 2015-08-28 11:17:42 +02:00
spring-beans-groovy/src/main Class identity comparisons wherever possible 2015-05-20 14:34:16 +02:00
spring-context MethodValidationInterceptor falls back to invocation attempt with resolved bridge method (for Hibernate Validator 5.2 compatibility) 2015-08-27 19:13:29 +02:00
spring-context-support/src Polishing 2015-08-26 11:04:14 +02:00
spring-core/src Support implicit attribute aliases with @AliasFor 2015-08-28 18:56:17 +02:00
spring-expression Remove trailing whitespace in Java source code 2015-07-27 12:40:54 +02:00
spring-framework-bom Add link to docs 2015-08-16 13:46:26 +02:00
spring-instrument/src Harmonize log configuration 2014-03-20 09:43:29 -07:00
spring-instrument-tomcat/src TomcatInstrumentableClassLoader supports Tomcat 7.0.63+ as well 2015-07-15 00:02:55 +02:00
spring-jdbc/src Suppress recent deprecation warnings in tests 2015-08-27 17:57:50 +02:00
spring-jms/src Polishing 2015-07-29 01:08:16 +02:00
spring-messaging/src Update WebSocket docs on proxying @Controller 2015-08-25 22:14:36 -04:00
spring-orm/src HibernateJpaDialect logs warning in case of Connection mismatch (e.g. configured release mode other than ON_CLOSE) 2015-08-27 16:41:41 +02:00
spring-orm-hibernate4/src Suppress warnings in tests in spring-orm-hibernate4 2015-08-27 22:52:21 +02:00
spring-orm-hibernate5/src/main/java/org/springframework/orm/hibernate5 HibernateJpaDialect logs warning in case of Connection mismatch (e.g. configured release mode other than ON_CLOSE) 2015-08-27 16:41:41 +02:00
spring-oxm Deprecate XmlBeans support (following the XMLBeans retirement at Apache) 2015-08-27 11:52:50 +02:00
spring-test Clean up warnings in spring-test 2015-08-27 22:12:14 +02:00
spring-tx/src Add missing 4.2 XSDs 2015-08-01 09:50:36 +02:00
spring-web/src Polishing 2015-08-27 22:04:58 +02:00
spring-webmvc/src Removed misleading note on readonly and disabled flags in spring-form.tld 2015-08-27 11:50:10 +02:00
spring-webmvc-portlet/src Introduce 'value' alias for 'attribute' in @AliasFor 2015-07-29 15:27:06 +02:00
spring-webmvc-tiles2/src Suppress warnings in tests 2014-12-31 02:10:30 +01:00
spring-websocket/src Polishing 2015-08-27 22:04:58 +02:00
src Fix typo in reference documentation 2015-08-27 10:59:02 +02:00
.gitignore Add .gradletasknamecache to .gitignore 2013-11-18 10:12:19 -08:00
.mailmap Change gopivotal.com to pivotal.io 2014-10-05 18:12:50 +02:00
CONTRIBUTING-DOCUMENTATION.adoc Hard-wrap CONTRIBUTING-DOCUMENTATION at 90 chars 2014-01-09 16:35:14 -08:00
CONTRIBUTING.md Update links to Spring JIRA server 2014-03-10 12:26:29 +01:00
README.md Remove link to forums in README 2015-01-09 23:14:56 +01:00
build.gradle Latest dependency updates (Commons Pool 2.4.2, OkHttp 2.5) 2015-08-27 12:37:51 +02:00
gradle.properties Next Development Version 2015-07-31 02:03:23 -07:00
gradlew Replace MaxPermSize use in build scripts 2013-06-03 14:09:33 -07:00
gradlew.bat Upgrade to Gradle 1.8 and propdeps 0.0.5 2013-11-19 16:24:42 -08:00
import-into-eclipse.bat Fixed URLs in import-into-eclipse scripts 2013-09-25 16:56:10 -04:00
import-into-eclipse.sh Update Eclipse project import script 2014-12-13 14:24:01 +01:00
import-into-idea.md Update IDEA guidelines 2014-05-02 12:27:46 +02:00
settings.gradle Support for Hibernate ORM 5.0 Beta 2 2015-05-09 17:55:18 +02:00

README.md

Spring Framework

The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications -- on any kind of deployment platform. A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments.

The framework also serves as the foundation for Spring Integration, Spring Batch and the rest of the Spring family of projects. Browse the repositories under the Spring organization on GitHub for a full list.

Downloading Artifacts

See downloading Spring artifacts for Maven repository information. Unable to use Maven or other transitive dependency management tools? See building a distribution with dependencies.

Documentation

See the current Javadoc and reference docs.

Getting Support

Check out the spring tags on Stack Overflow. Commercial support is available too.

Issue Tracking

Report issues via the Spring Framework JIRA. Understand our issue management process by reading about the lifecycle of an issue. Think you've found a bug? Please consider submitting a reproduction project via the spring-framework-issues GitHub repository. The readme there provides simple step-by-step instructions.

Building from Source

The Spring Framework uses a Gradle-based build system. In the instructions below, ./gradlew is invoked from the root of the source tree and serves as a cross-platform, self-contained bootstrap mechanism for the build.

Prerequisites

Git and JDK 8 update 20 or later

Be sure that your JAVA_HOME environment variable points to the jdk1.8.0 folder extracted from the JDK download.

Check out sources

git clone git@github.com:spring-projects/spring-framework.git

Import sources into your IDE

Run ./import-into-eclipse.sh or read import-into-idea.md as appropriate.

Note: Per the prerequisites above, ensure that you have JDK 8 configured properly in your IDE.

Install all spring-* jars into your local Maven cache

./gradlew install

Compile and test; build all jars, distribution zips, and docs

./gradlew build

... and discover more commands with ./gradlew tasks. See also the Gradle build and release FAQ.

Contributing

Pull requests are welcome; see the contributor guidelines for details.

Staying in Touch

Follow @SpringCentral as well as @SpringFramework and its team members on Twitter. In-depth articles can be found at The Spring Blog, and releases are announced via our news feed.

License

The Spring Framework is released under version 2.0 of the Apache License.