summaryrefslogtreecommitdiff
path: root/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java
diff options
context:
space:
mode:
authorEmmanuel Bourg <ebourg@apache.org>2016-08-02 11:13:32 +0200
committerEmmanuel Bourg <ebourg@apache.org>2016-08-02 11:13:32 +0200
commitf69f2a4b8ea697b3a631c0dc7a470e3c9793fee3 (patch)
treedb2f25b29aa3e59c463ab41d3f2856f6265bb1a5 /spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java
parent5575b60c30c5a0c308c4ba3a2db93956d8c1746c (diff)
Imported Upstream version 4.2.6
Diffstat (limited to 'spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java')
-rw-r--r--spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java b/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java
index eb8776cf..17fda815 100644
--- a/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java
+++ b/spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2013 the original author or authors.
+ * Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,22 +29,28 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* Activates a Spring {@link LoadTimeWeaver} for this application context, available as
* a bean with the name "loadTimeWeaver", similar to the {@code <context:load-time-weaver>}
* element in Spring XML.
- * To be used
- * on @{@link org.springframework.context.annotation.Configuration Configuration} classes;
+ *
+ * <p>To be used on @{@link org.springframework.context.annotation.Configuration Configuration} classes;
* the simplest possible example of which follows:
+ *
* <pre class="code">
* &#064;Configuration
* &#064;EnableLoadTimeWeaving
* public class AppConfig {
+ *
* // application-specific &#064;Bean definitions ...
* }</pre>
*
* The example above is equivalent to the following Spring XML configuration:
+ *
* <pre class="code">
* {@code
* <beans>
+ *
* <context:load-time-weaver/>
+ *
* <!-- application-specific <bean> definitions -->
+ *
* </beans>
* }</pre>
*
@@ -61,10 +67,12 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* {@code @EnableLoadTimeWeaving} may also implement the {@link LoadTimeWeavingConfigurer}
* interface and return a custom {@code LoadTimeWeaver} instance through the
* {@code #getLoadTimeWeaver} method:
+ *
* <pre class="code">
* &#064;Configuration
* &#064;EnableLoadTimeWeaving
* public class AppConfig implements LoadTimeWeavingConfigurer {
+ *
* &#064;Override
* public LoadTimeWeaver getLoadTimeWeaver() {
* MyLoadTimeWeaver ltw = new MyLoadTimeWeaver();
@@ -75,10 +83,13 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* }</pre>
*
* <p>The example above can be compared to the following Spring XML configuration:
+ *
* <pre class="code">
* {@code
* <beans>
+ *
* <context:load-time-weaver weaverClass="com.acme.MyLoadTimeWeaver"/>
+ *
* </beans>
* }</pre>
*
@@ -94,6 +105,7 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* be registered through {@link LoadTimeWeaver#addTransformer}. AspectJ weaving will be
* activated by default if a "META-INF/aop.xml" resource is present on the classpath.
* Example:
+ *
* <pre class="code">
* &#064;Configuration
* &#064;EnableLoadTimeWeaving(aspectjWeaving=ENABLED)
@@ -101,10 +113,13 @@ import org.springframework.instrument.classloading.LoadTimeWeaver;
* }</pre>
*
* <p>The example above can be compared to the following Spring XML configuration:
+ *
* <pre class="code">
* {@code
* <beans>
+ *
* <context:load-time-weaver aspectj-weaving="on"/>
+ *
* </beans>
* }</pre>
*
@@ -131,7 +146,8 @@ public @interface EnableLoadTimeWeaving {
*/
AspectJWeaving aspectjWeaving() default AspectJWeaving.AUTODETECT;
- public enum AspectJWeaving {
+
+ enum AspectJWeaving {
/**
* Switches on Spring-based AspectJ load-time weaving.
@@ -151,4 +167,5 @@ public @interface EnableLoadTimeWeaving {
*/
AUTODETECT;
}
+
}