Thread-Safety
This class is immutable and can be shared between threads without safe publication.| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final AnnotationInstance[] | |
| private final DotName | |
| pack-priv static final AnnotationInstance. | |
| pack-priv static final DotName | |
| private final boolean | |
| private final AnnotationTarget | |
| private final AnnotationValue[] |
| Access | Constructor and Description |
|---|---|
| private | AnnotationInstance(DotName name, AnnotationTarget target, AnnotationValue[] values, boolean runtimeVisible)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static AnnotationInstance | |
| public static AnnotationInstanceBuilder | Returns: a builder instance, nevernullthe type of annotation whose instance will be created, must not be annotationType)nullCreates a builder of annotation instances of given |
| public static AnnotationInstanceBuilder | |
| public static AnnotationInstanceBuilder | |
| public static AnnotationInstanceBuilder | |
| pack-priv static AnnotationInstance | |
| public static AnnotationInstance | Returns: the new mock Annotation Instancethe name of the annotation instance name, AnnotationTarget the thing the annotation is declared on target, AnnotationValue[] the members of this annotation instance values)Construct a new mock annotation instance. |
| public static AnnotationInstance | Returns: the new mock Annotation Instancethe name of the annotation instance name, boolean whether the annotation is visible at runtime via the reflection API visible, AnnotationTarget the thing the annotation is declared on target, AnnotationValue[] the members of this annotation instance values)Construct a new mock annotation instance. |
| public static AnnotationInstance | Returns: the new mock Annotation Instancethe name of the annotation instance name, AnnotationTarget the thing the annotation is declared on target, List<AnnotationValue> the members of this annotation instance values)Construct a new mock annotation instance. |
| public static AnnotationInstance | Returns: the new mock Annotation Instancethe name of the annotation instance name, boolean whether the annotation is visible at runtime via the reflection API visible, AnnotationTarget the thing the annotation is declared on target, List<AnnotationValue> the members of this annotation instance values)Construct a new mock annotation instance. |
| public AnnotationInstanceEquivalenceProxy | |
| public boolean | Returns: true if equal, false if notthe annotation instance to compare to o)Overrides java. |
| public int | Returns: hash code consistent with annotation equivalenceReturns an equivalence hash code. |
| public boolean | Returns: true if equivalent, false if notthe annotation instance to compare to other)Returns whether this annotation instance is equivalent to the |
| public int | Returns: the hash code of this objectOverrides java. |
| public DotName | |
| public boolean | runtimeVisible()
Returns true if this annotation uses RetentionPolicy.RUNTIME and is visible to runtime reflection. |
| public AnnotationTarget | Returns: the target this annotation instance refers toThe program element that this annotation was declared on. |
| public String | Returns: a string representation for this objectwhether to provide a simpler string representation simple)Returns an optionally simplified string that represents this annotation instance. |
| public String | Returns: a simple string representation for this annotation instanceOverrides java. |
| public AnnotationValue | |
| public AnnotationValue | |
| pack-priv AnnotationValue[] | |
| public List | Returns: immutable list of this annotation's membersReturns an immutable list of all members of this annotation instance. |
| public List | Returns: immutable list of this annotation's membersReturns a list of all members of this annotation instance, including default values if defined. |
| public AnnotationValue | Returns: the annotation member with specified name, ornullthe index containing the defining annotation class index, String the name of the annotation member name)Returns the member of this annotation that has the specified name, accounting for its default value. |
| public AnnotationValue | Returns: thevalue annotation member, or nullthe index containing the defining annotation class index)Returns the member of this annotation that has special name |
| EMPTY_ARRAY | back to summary |
|---|---|
| pack-priv static final AnnotationInstance[] EMPTY_ARRAY | |
| name | back to summary |
|---|---|
| private final DotName name | |
| NAME_COMPARATOR | back to summary |
|---|---|
| pack-priv static final AnnotationInstance. | |
| RETENTION | back to summary |
|---|---|
| pack-priv static final DotName RETENTION | |
| runtimeVisible | back to summary |
|---|---|
| private final boolean runtimeVisible | |
| target | back to summary |
|---|---|
| private final AnnotationTarget target | |
| values | back to summary |
|---|---|
| private final AnnotationValue[] values | |
| AnnotationInstance | back to summary |
|---|---|
| private AnnotationInstance(DotName name, AnnotationTarget target, AnnotationValue[] values, boolean runtimeVisible) | |
| binarySearch | back to summary |
|---|---|
| pack-priv static AnnotationInstance binarySearch(AnnotationInstance[] annotations, DotName name) | |
| builder | back to summary |
|---|---|
| public static AnnotationInstanceBuilder builder(Class<? extends Annotation> annotationType) Creates a builder of annotation instances of given
| |
| builder | back to summary |
|---|---|
| public static AnnotationInstanceBuilder builder(ClassInfo annotationType) Creates a builder of annotation instances of given
| |
| builder | back to summary |
|---|---|
| public static AnnotationInstanceBuilder builder(DotName annotationType) Creates a builder of annotation instances of given
The given
| |
| builder | back to summary |
|---|---|
| public static AnnotationInstanceBuilder builder(DotName annotationType, boolean runtimeVisible) Creates a builder of annotation instances of given
| |
| create | back to summary |
|---|---|
| pack-priv static AnnotationInstance create(AnnotationInstance instance, AnnotationTarget target) | |
| create | back to summary |
|---|---|
| public static AnnotationInstance create(DotName name, AnnotationTarget target, AnnotationValue[] values) Construct a new mock annotation instance. The passed
| |
| create | back to summary |
|---|---|
| public static AnnotationInstance create(DotName name, boolean visible, AnnotationTarget target, AnnotationValue[] values) Construct a new mock annotation instance. The passed
| |
| create | back to summary |
|---|---|
| public static AnnotationInstance create(DotName name, AnnotationTarget target, List<AnnotationValue> values) Construct a new mock annotation instance. The passed
| |
| create | back to summary |
|---|---|
| public static AnnotationInstance create(DotName name, boolean visible, AnnotationTarget target, List<AnnotationValue> values) Construct a new mock annotation instance. The passed
| |
| createEquivalenceProxy | back to summary |
|---|---|
| public AnnotationInstanceEquivalenceProxy createEquivalenceProxy() Returns an equivalence proxy for this annotation instance. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Returns whether this annotation instance is equal to another instance.
Two annotation instances are equal if their names and values of their members are equal,
and they share the exact same
| |
| equivalenceHashCode | back to summary |
|---|---|
| public int equivalenceHashCode() Returns an equivalence hash code. This is consistent with
| |
| equivalentTo | back to summary |
|---|---|
| public boolean equivalentTo(AnnotationInstance other) Returns whether this annotation instance is equivalent to the
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code representing this object.
| |
| name | back to summary |
|---|---|
| public DotName name() The name of this annotation in DotName form.
| |
| runtimeVisible | back to summary |
|---|---|
| public boolean runtimeVisible() Returns true if this annotation uses RetentionPolicy.RUNTIME and is visible to runtime reflection.
| |
| target | back to summary |
|---|---|
| public AnnotationTarget target() The program element that this annotation was declared on. This can be
a class, a field, a method, a method parameter, or a type in case of
type annotations. In addition, it may be
| |
| toString | back to summary |
|---|---|
| public String toString(boolean simple) Returns an optionally simplified string that represents this annotation instance. If simplified the output is smaller but missing information, such as the package qualifier.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation for this annotation instance. This method is equivalent
to calling
| |
| value | back to summary |
|---|---|
| public AnnotationValue value(final String name) Returns the member of this annotation that has the specified name.
If the member was not specified by this instance,
| |
| value | back to summary |
|---|---|
| public AnnotationValue value() Returns the member that has the special default name
| |
| valueArray | back to summary |
|---|---|
| pack-priv AnnotationValue[] valueArray() | |
| values | back to summary |
|---|---|
| public List Returns an immutable list of all members of this annotation instance. While random access is allowed, the ordering algorithm of the list should not be relied upon. Although it will be consistent for the life of this instance.
| |
| valuesWithDefaults | back to summary |
|---|---|
| public List Returns a list of all members of this annotation instance, including default
values if defined. Since an annotation's defaults are only stored on the
annotation's defining class, and not usages of the annotation, an index
containing the annotation class must be provided as a parameter. If the index
does not contain the defining annotation class, then an
The order of this list is undefined.
| |
| valueWithDefault | back to summary |
|---|---|
| public AnnotationValue valueWithDefault(IndexView index, String name) Returns the member of this annotation that has the specified name,
accounting for its default value. Since an annotation's defaults are
only stored on the annotation's defining class, and not usages of the
annotation, an index containing the annotation class must be provided
as a parameter. If the index does not contain the defining annotation
class, then an
If the member was not specified by this annotation instance, then the
annotation's
| |
| valueWithDefault | back to summary |
|---|---|
| public AnnotationValue valueWithDefault(IndexView index) Returns the member of this annotation that has special name
If the
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(AnnotationInstance
the first object to be compared. instance1, AnnotationInstance the second object to be compared. instance2)Implements java. |
| NameComparator | back to summary |
|---|---|
| pack-priv NameComparator() | |
| compare | back to summary |
|---|---|
| public int compare(AnnotationInstance instance1, AnnotationInstance instance2) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |