diff options
author | Emmanuel Bourg <ebourg@apache.org> | 2016-08-02 11:13:32 +0200 |
---|---|---|
committer | Emmanuel Bourg <ebourg@apache.org> | 2016-08-02 11:13:32 +0200 |
commit | f69f2a4b8ea697b3a631c0dc7a470e3c9793fee3 (patch) | |
tree | db2f25b29aa3e59c463ab41d3f2856f6265bb1a5 /spring-context/src/main/java/org/springframework/context/annotation/EnableLoadTimeWeaving.java | |
parent | 5575b60c30c5a0c308c4ba3a2db93956d8c1746c (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.java | 25 |
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"> * @Configuration * @EnableLoadTimeWeaving * public class AppConfig { + * * // application-specific @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"> * @Configuration * @EnableLoadTimeWeaving * public class AppConfig implements LoadTimeWeavingConfigurer { + * * @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"> * @Configuration * @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; } + } |