MergedAnnotations
collection. Presents a view onto an annotation where attribute values may
have been "merged" from different source values.
Attribute values may be accessed using the various get methods.
For example, to access an int attribute the getInt(String)
method would be used.
Note that attribute values are not converted when accessed.
For example, it is not possible to call getString(String) if the
underlying attribute is an int. The only exception to this rule is
Class and Class[] values which may be accessed as
String and String[] respectively to prevent potential early
class initialization.
If necessary, a MergedAnnotation can be synthesized back into an actual java..
MergedAnnotations, MergedAnnotationPredicates
| Modifier and Type | Class and Description |
|---|---|
| public static enum | MergedAnnotation.Adapt
Adaptations that can be applied to attribute values when creating
Maps or
|
| Modifier and Type | Field and Description |
|---|---|
| public static final String | VALUE
The attribute name for annotations with a single element. |
| Modifier and Type | Method and Description |
|---|---|
| public AnnotationAttributes | Returns: an immutable map containing the attributes and valuesthe adaptations that should be applied to the annotation values adaptationsCreate a new mutable |
| public Map | Returns: an immutable map containing the attributes and valuesthe adaptations that should be applied to the annotation values adaptationsGet an immutable |
| public <T extends Map | Returns: a map containing the attributes and valuesa map factory factory, MergedAnnotation.the adaptations that should be applied to the annotation values adaptationsCreate a new |
| public MergedAnnotation | Returns: a filtered view of the annotationa predicate used to filter attribute names predicate)Create a new view of the annotation with only attributes that match the given predicate. |
| public MergedAnnotation | Returns: a filtered view of the annotation without any attributes that have a default valueCreate a new view of the annotation with all attributes that have default values removed. |
| public static <A extends Annotation> MergedAnnotation | Returns: aMergedAnnotation instance containing the annotationthe annotation to include annotation)Create a new |
| public static <A extends Annotation> MergedAnnotation | Returns: aMergedAnnotation instance for the annotationthe source for the annotation. This source is used only for
information and logging. It does not need to actually contain
the specified annotations, and it will not be searched. source, A the annotation to include annotation)Create a new |
| public int | Returns: the aggregate index (starting at0) or -1 if the
annotation is missingGet the index of the aggregate collection containing this annotation. |
| public <T extends Annotation> MergedAnnotation | Returns: the value as aMergedAnnotationthe attribute name attributeName, Class<T> the annotation type type)Get a required annotation attribute value from the annotation. |
| public <T extends Annotation> MergedAnnotation | Returns: the value as aMergedAnnotation arraythe attribute name attributeName, Class<T> the annotation type type)Get a required annotation array attribute value from the annotation. |
| public boolean | Returns: the value as a booleanthe attribute name attributeName)Get a required boolean attribute value from the annotation. |
| public boolean[] | Returns: the value as a boolean arraythe attribute name attributeName)Get a required boolean array attribute value from the annotation. |
| public byte | |
| public byte[] | Returns: the value as a byte arraythe attribute name attributeName)Get a required byte array attribute value from the annotation. |
| public char | |
| public char[] | Returns: the value as a char arraythe attribute name attributeName)Get a required char array attribute value from the annotation. |
| public Class | |
| public Class | Returns: the value as a class arraythe attribute name attributeName)Get a required class array attribute value from the annotation. |
| public Optional | Returns: an optional of the default value orOptional#empty() if
there is no matching attribute or no defined defaultthe attribute name attributeName)Get the default attribute value from the annotation as specified in the annotation declaration. |
| public <T> Optional | Returns: an optional of the default value orOptional#empty() if
there is no matching attribute or no defined defaultthe attribute name attributeName, Class<T> the attribute type. Must be compatible with the underlying
attribute type or type)Object.class.Get the default attribute value from the annotation as specified in the annotation declaration. |
| public int | Returns: the annotation distance or-1 if the annotation is missingGet the distance of this annotation related to its use as a meta-annotation. |
| public double | |
| public double[] | Returns: the value as a double arraythe attribute name attributeName)Get a required double array attribute value from the annotation. |
| public <E extends Enum | |
| public <E extends Enum | Returns: the value as an enum arraythe attribute name attributeName, Class<E> the enum type type)Get a required enum array attribute value from the annotation. |
| public float | |
| public float[] | Returns: the value as a float arraythe attribute name attributeName)Get a required float array attribute value from the annotation. |
| public int | |
| public int[] | Returns: the value as an int arraythe attribute name attributeName)Get a required int array attribute value from the annotation. |
| public long | |
| public long[] | Returns: the value as a long arraythe attribute name attributeName)Get a required long array attribute value from the annotation. |
| public MergedAnnotation | Returns: the meta-annotation source ornullGet the source of the meta-annotation, or |
| public List | Returns: the meta types for the annotationGet the complete list of annotation types within the annotation hierarchy
from this annotation to the |
| public MergedAnnotation | |
| public short | |
| public short[] | Returns: the value as a short arraythe attribute name attributeName)Get a required short array attribute value from the annotation. |
| public Object | Returns: the source, ornullGet the source that ultimately declared the root annotation, or
|
| public String | |
| public String[] | Returns: the value as a string arraythe attribute name attributeName)Get a required string array attribute value from the annotation. |
| public Class | |
| public Optional | Returns: an optional value orOptional#empty() if there is no
matching attributethe attribute name attributeName)Get an optional attribute value from the annotation. |
| public <T> Optional | Returns: an optional value orOptional#empty() if there is no
matching attributethe attribute name attributeName, Class<T> the attribute type. Must be compatible with the underlying
attribute type or type)Object.class.Get an optional attribute value from the annotation. |
| public boolean | Returns: true if the attribute value is the same as the default
valuethe attribute name attributeName)Determine if the specified attribute name has a default value when compared to the annotation declaration. |
| public boolean | Returns: true if the attribute value is different from the default
valuethe attribute name attributeName)Determine if the specified attribute name has a non-default value when compared to the annotation declaration. |
| public boolean | Returns: true if the annotation is directly presentDetermine if the annotation is directly present on the source. |
| public boolean | Returns: true if the annotation is meta-presentDetermine if the annotation is meta-present on the source. |
| public boolean | Returns: true if the annotation is presentDetermine if the annotation is present on the source. |
| public static <A extends Annotation> MergedAnnotation | Returns: an instance representing a missing annotationCreate a |
| public static <A extends Annotation> MergedAnnotation | Returns: aMergedAnnotation instance for the annotationthe annotation type annotationType)Create a new |
| public static <A extends Annotation> MergedAnnotation | Returns: aMergedAnnotation instance for the annotation and attributesthe annotation type annotationType, Map<String, ?> the annotation attributes or attributes)null if just default
values should be usedCreate a new |
| public static <A extends Annotation> MergedAnnotation | Returns: aMergedAnnotation instance for the annotation and attributesthe source for the annotation. This source is used only for
information and logging. It does not need to actually contain
the specified annotations and it will not be searched. source, Class<A> the annotation type annotationType, Map<String, ?> the annotation attributes or attributes)null if just default
values should be usedCreate a new |
| public static <A extends Annotation> MergedAnnotation | Returns: aMergedAnnotation instance for the annotation and attributesthe class loader used to resolve class attributes classLoader, Object the source for the annotation. This source is used only for
information and logging. It does not need to actually contain
the specified annotations and it will not be searched. source, Class<A> the annotation type annotationType, Map<String, ?> the annotation attributes or attributes)null if just default
values should be usedCreate a new |
| public A | Returns: a synthesized version of the annotation or the original annotation unmodifiedCreate a type-safe synthesized version of this merged annotation that can be used directly in code. |
| public Optional | Returns: an optional containing the synthesized version of the annotation or an empty optional if the condition doesn't matchthe test to determine if the annotation can be synthesized condition)Optionally create a type-safe synthesized version of this annotation based on a condition predicate. |
| public MergedAnnotation | Returns: a non-merged view of the annotationCreate a new view of the annotation that exposes non-merged attribute values. |