Class AnnotationInvocationHandler
java.lang.Object
com.strobel.reflection.emit.AnnotationInvocationHandler
- All Implemented Interfaces:
Serializable, InvocationHandler
InvocationHandler for dynamic proxy implementation of Annotation.
- Since:
- 1.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Method[]private static final longprivate final Class<? extends Annotation> -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationInvocationHandler(Class<? extends Annotation> type, Map<String, Object> memberValues) -
Method Summary
Modifier and TypeMethodDescriptionprivate AnnotationInvocationHandlerReturns an object's invocation handler if that object is a dynamic proxy with a handler of type AnnotationInvocationHandler.private static ObjectcloneArray(Object array) This method, which clones its array argument, would not be necessary if Cloneable had a public clone method.private BooleanequalsImpl(Object o) Implementation of dynamicProxy.equals(Object o)private Method[]Returns the member methods for our annotation type.private intImplementation of dynamicProxy.hashCode()private static booleanmemberValueEquals(Object v1, Object v2) Returns true iff the two member values in "dynamic proxy return form" are equal using the appropriate equality function depending on the member type.private static intmemberValueHashCode(Object value) Computes hashCode of a member value (in "dynamic proxy return form")private static StringmemberValueToString(Object value) Translates a member value (in "dynamic proxy return form") into a stringprivate voidprivate StringImplementation of dynamicProxy.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
type
-
memberValues
-
memberMethods
-
-
Constructor Details
-
AnnotationInvocationHandler
AnnotationInvocationHandler(Class<? extends Annotation> type, Map<String, Object> memberValues)
-
-
Method Details
-
invoke
-
cloneArray
-
toStringImpl
Implementation of dynamicProxy.toString() -
memberValueToString
-
equalsImpl
-
asOneOfUs
Returns an object's invocation handler if that object is a dynamic proxy with a handler of type AnnotationInvocationHandler. Returns null otherwise. -
memberValueEquals
Returns true iff the two member values in "dynamic proxy return form" are equal using the appropriate equality function depending on the member type. The two values will be of the same type unless one of the containing annotations is ill-formed. If one of the containing annotations is ill-formed, this method will return false unless the two members are identical object references. -
getMemberMethods
Returns the member methods for our annotation type. These are obtained lazily and cached, as they're expensive to obtain, and we only need them if our `equals` method is invoked (which should be rare). -
hashCodeImpl
private int hashCodeImpl()Implementation of dynamicProxy.hashCode() -
memberValueHashCode
Computes hashCode of a member value (in "dynamic proxy return form") -
readObject
- Throws:
IOExceptionClassNotFoundException
-