Annotation that pretends it is a
"real" source code annotation. It's also an InvocationHandler.
When you create an AnnotationProxy, you must initialize it
with an AnnotationDescriptor.
The adapter checks that the provided elements are the same elements defined
in the annotation interface. However, it does not check that their
values are the right type. If you omit an element, the adapter will use the
default value for that element from the annotation interface, if it exists.
If no default exists, it will throw an exception.
java.lang.annotation.Annotation
| Modifier and Type | Field and Description |
|---|---|
| private final AnnotationDescriptor | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Class | annotationType()
Implements java. |
| private boolean | |
| public boolean | Returns: Whether the given object is equal to this annotation proxy or notThe object to compare obj)Overrides java. Implements java. Annotation#equals(Object).
|
| private @IgnoreForbiddenApisErrors(reason: "SecurityManager is deprecated in JDK17") Map | |
| public int | Returns: The hash code of this proxy.Overrides java. Implements java. Annotation#hashCode().
|
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. |
| private <T> T | run(PrivilegedAction<T> action)
Runs the given privileged action, using a privileged block if required. |
| public String | toString()
Overrides java. Implements java. |
| descriptor | back to summary |
|---|---|
| private final AnnotationDescriptor<? extends Annotation> descriptor | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| AnnotationProxy | back to summary |
|---|---|
| pack-priv AnnotationProxy(AnnotationDescriptor<? extends Annotation> descriptor) | |
| annotationType | back to summary |
|---|---|
| public Class Implements java. Doc from java. Returns the annotation interface of this annotation.
| |
| areEqual | back to summary |
|---|---|
| private boolean areEqual(Object o1, Object o2) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Implements java. Performs an equality check as described in
| |
| getAnnotationAttributes | back to summary |
|---|---|
private @IgnoreForbiddenApisErrors(reason: "SecurityManager is deprecated in JDK17") Map
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Calculates the hash code of this annotation proxy as described in
| |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| run | back to summary |
|---|---|
| private <T> T run(PrivilegedAction<T> action) Runs the given privileged action, using a privileged block if required. Note This must never be changed into a publicly available method to avoid execution of arbitrary privileged actions within HV's protection domain.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Doc from java. Returns a string representation of this annotation. The details of the representation are implementation-dependent, but the following may be regarded as typical: @com.example.Name(first="Duke", middle="of", last="Java") | |