Browse Source

Document SynthesizedAnnotationInvocationHandler constructor

Issue: SPR-11512
pull/808/head
Sam Brannen 10 years ago
parent
commit
a1fc2097a1
  1. 2
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java
  2. 11
      spring-core/src/main/java/org/springframework/core/annotation/SynthesizedAnnotationInvocationHandler.java

2
spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

@ -1061,7 +1061,7 @@ public abstract class AnnotationUtils { @@ -1061,7 +1061,7 @@ public abstract class AnnotationUtils {
return annotation;
}
InvocationHandler handler = new SynthesizedAnnotationInvocationHandler(annotatedElement, annotation,
InvocationHandler handler = new SynthesizedAnnotationInvocationHandler(annotation, annotatedElement,
getAttributeAliasMap(annotationType));
A synthesizedAnnotation = (A) Proxy.newProxyInstance(ClassUtils.getDefaultClassLoader(), new Class<?>[] {
(Class<A>) annotationType, SynthesizedAnnotation.class }, handler);

11
spring-core/src/main/java/org/springframework/core/annotation/SynthesizedAnnotationInvocationHandler.java

@ -58,7 +58,16 @@ class SynthesizedAnnotationInvocationHandler implements InvocationHandler { @@ -58,7 +58,16 @@ class SynthesizedAnnotationInvocationHandler implements InvocationHandler {
private final Map<String, String> aliasMap;
SynthesizedAnnotationInvocationHandler(AnnotatedElement annotatedElement, Annotation annotation,
/**
* Construct a new {@code SynthesizedAnnotationInvocationHandler}.
*
* @param annotation the annotation to synthesize
* @param annotatedElement the element that is annotated with the supplied
* annotation; may be {@code null} if unknown
* @param aliasMap the map of attribute alias pairs, declared via
* {@code @AliasFor} in the supplied annotation
*/
SynthesizedAnnotationInvocationHandler(Annotation annotation, AnnotatedElement annotatedElement,
Map<String, String> aliasMap) {
this.annotatedElement = annotatedElement;
this.annotation = annotation;

Loading…
Cancel
Save