class SynthesizedAnnotationInvocationHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler
InvocationHandler
for an Annotation
that Spring has
synthesized (i.e., wrapped in a dynamic proxy) with additional
functionality.Annotation
,
AnnotationAttributeExtractor
,
AnnotationUtils.synthesizeAnnotation(Annotation, AnnotatedElement)
Modifier and Type | Field and Description |
---|---|
private AnnotationAttributeExtractor<?> |
attributeExtractor |
private java.util.Map<java.lang.String,java.lang.Object> |
valueCache |
Constructor and Description |
---|
SynthesizedAnnotationInvocationHandler(AnnotationAttributeExtractor<?> attributeExtractor)
Construct a new
SynthesizedAnnotationInvocationHandler for
the supplied AnnotationAttributeExtractor . |
Modifier and Type | Method and Description |
---|---|
private boolean |
annotationEquals(java.lang.Object other)
See
Annotation.equals(Object) for a definition of the required algorithm. |
private int |
annotationHashCode()
See
Annotation.hashCode() for a definition of the required algorithm. |
private java.lang.String |
annotationToString()
See
Annotation.toString() for guidelines on the recommended format. |
private java.lang.Class<? extends java.lang.annotation.Annotation> |
annotationType() |
private java.lang.String |
attributeValueToString(java.lang.Object value) |
private java.lang.Object |
cloneArray(java.lang.Object array)
Clone the provided array, ensuring that original component type is
retained.
|
private java.lang.Object |
getAttributeValue(java.lang.reflect.Method attributeMethod) |
private int |
hashCodeForArray(java.lang.Object array)
WARNING: we can NOT use any of the
nullSafeHashCode() methods
in Spring's ObjectUtils because those hash code generation
algorithms do not comply with the requirements specified in
Annotation.hashCode() . |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
private final AnnotationAttributeExtractor<?> attributeExtractor
private final java.util.Map<java.lang.String,java.lang.Object> valueCache
SynthesizedAnnotationInvocationHandler(AnnotationAttributeExtractor<?> attributeExtractor)
SynthesizedAnnotationInvocationHandler
for
the supplied AnnotationAttributeExtractor
.attributeExtractor
- the extractor to delegate topublic java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
private java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
private java.lang.Object getAttributeValue(java.lang.reflect.Method attributeMethod)
private java.lang.Object cloneArray(java.lang.Object array)
array
- the array to cloneprivate boolean annotationEquals(java.lang.Object other)
Annotation.equals(Object)
for a definition of the required algorithm.other
- the other object to compare againstprivate int annotationHashCode()
Annotation.hashCode()
for a definition of the required algorithm.private int hashCodeForArray(java.lang.Object array)
nullSafeHashCode()
methods
in Spring's ObjectUtils
because those hash code generation
algorithms do not comply with the requirements specified in
Annotation.hashCode()
.array
- the array to compute the hash code forprivate java.lang.String annotationToString()
Annotation.toString()
for guidelines on the recommended format.private java.lang.String attributeValueToString(java.lang.Object value)