public final class AnnotationMetadataHierarchy extends java.lang.Object implements AnnotationMetadata, java.lang.Iterable<AnnotationMetadata>
AnnotationMetadata
instance passed
to the constructor represents the annotation metadata that is declared, hence methods like hasDeclaredAnnotation(String)
will return true for the last annotation metadata passed in the hierarchy.
This class is used to internally optimize memory usage and compilation time for classes that declare AOP advice at the type level and where the classes methods typically don't include any annotations and therefore would be wasteful to generate additional annotation metadata classes.
Modifier and Type | Field and Description |
---|---|
static AnnotationMetadata[] |
EMPTY_HIERARCHY
Constant to represent an empty hierarchy.
|
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Constructor and Description |
---|
AnnotationMetadataHierarchy(AnnotationMetadata... hierarchy)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.Boolean> |
booleanValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The value as an optional boolean for the given annotation and member.
|
java.util.Optional<java.lang.Boolean> |
booleanValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
java.util.Optional<java.lang.Boolean> |
booleanValue(java.lang.String annotation,
java.lang.String member)
The value as an optional boolean for the given annotation and member.
|
java.util.Optional<java.lang.Boolean> |
booleanValue(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
java.util.Optional<java.lang.Class> |
classValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The value of the annotation as a Class.
|
java.util.Optional<java.lang.Class> |
classValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.
|
java.util.Optional<java.lang.Class> |
classValue(java.lang.String annotation,
java.lang.String member)
The value of the annotation as a Class.
|
java.util.Optional<java.lang.Class> |
classValue(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the class value and optionally map its value.
|
<T> java.lang.Class<T>[] |
classValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The value of the annotation as a Class.
|
<T> java.lang.Class<T>[] |
classValues(java.lang.String annotation,
java.lang.String member)
The value of the annotation as a Class.
|
AnnotationMetadata |
createSibling(AnnotationMetadata child)
Create a new hierarchy instance from this metadata using this metadata's parents.
|
java.util.OptionalDouble |
doubleValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The value as an
OptionalDouble for the given annotation and member. |
java.util.OptionalDouble |
doubleValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the double value and optionally map its value.
|
java.util.OptionalDouble |
doubleValue(java.lang.String annotation,
java.lang.String member)
The value as an
OptionalDouble for the given annotation and member. |
java.util.OptionalDouble |
doubleValue(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the double value and optionally map its value.
|
<E extends java.lang.Enum> |
enumValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.lang.Class<E> enumType)
The value of the annotation as a Class.
|
<E extends java.lang.Enum> |
enumValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.lang.Class<E> enumType,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the enum value and optionally map its value.
|
<E extends java.lang.Enum> |
enumValue(java.lang.String annotation,
java.lang.String member,
java.lang.Class<E> enumType)
The value of the annotation as a Class.
|
<E extends java.lang.Enum> |
enumValue(java.lang.String annotation,
java.lang.String member,
java.lang.Class<E> enumType,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the enum value and optionally map its value.
|
<E extends java.lang.Enum> |
enumValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.lang.Class<E> enumType)
The enum values for the given annotation.
|
<E extends java.lang.Enum> |
enumValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.lang.Class<E> enumType,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the enum values and optionally map its value.
|
<E extends java.lang.Enum> |
enumValues(java.lang.String annotation,
java.lang.String member,
java.lang.Class<E> enumType)
The enum values for the given annotation.
|
<E extends java.lang.Enum> |
enumValues(java.lang.String annotation,
java.lang.String member,
java.lang.Class<E> enumType,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the enum values and optionally map its value.
|
<T extends java.lang.annotation.Annotation> |
findAnnotation(java.lang.String annotation)
Find an
AnnotationValue for the given annotation name. |
<T extends java.lang.annotation.Annotation> |
findDeclaredAnnotation(java.lang.String annotation)
Get all of the values for the given annotation that are directly declared on the annotated element.
|
java.util.Optional<java.lang.String> |
findRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Find repeatable annotation container.
|
java.util.Optional<java.lang.String> |
findRepeatableAnnotation(java.lang.String annotation)
Find repeatable annotation container.
|
java.util.Set<java.lang.String> |
getAnnotationNames()
All the annotation names this metadata declares.
|
java.util.List<java.lang.String> |
getAnnotationNamesByStereotype(java.lang.String stereotype)
Resolve all of the annotation names that feature the given stereotype.
|
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getAnnotationType(java.lang.String name)
Gets the type for a given annotation if it is present on the classpath.
|
java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getAnnotationType(java.lang.String name,
java.lang.ClassLoader classLoader)
Gets the type for a given annotation if it is present on the classpath.
|
<T extends java.lang.annotation.Annotation> |
getAnnotationValuesByType(java.lang.Class<T> annotationType)
Gets all the annotation values by the given repeatable type.
|
java.util.Set<java.lang.String> |
getDeclaredAnnotationNames()
All the declared annotation names this metadata declares.
|
<T extends java.lang.annotation.Annotation> |
getDeclaredAnnotationValuesByType(java.lang.Class<T> annotationType)
Gets only declared annotation values by the given repeatable type.
|
AnnotationMetadata |
getDeclaredMetadata()
Gets the declared metadata without inherited metdata.
|
<T> java.util.Optional<T> |
getDefaultValue(java.lang.String annotation,
java.lang.String member,
Argument<T> requiredType)
Return the default value for the given annotation member.
|
java.util.Map<java.lang.String,java.lang.Object> |
getDefaultValues(java.lang.String annotation)
Return the default values for the given annotation name.
|
AnnotationMetadata |
getRootMetadata() |
<T> java.util.Optional<T> |
getValue(java.lang.String annotation,
java.lang.String member,
Argument<T> requiredType,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Resolves the given value performing type conversion as necessary.
|
<T> OptionalValues<T> |
getValues(java.lang.String annotation,
java.lang.Class<T> valueType)
Get all of the values for the given annotation and type of the underlying values.
|
boolean |
hasAnnotation(java.lang.String annotation)
Checks whether this object has the given annotation on the object itself or inherited from a parent.
|
boolean |
hasDeclaredAnnotation(java.lang.String annotation)
Checks whether this object has the given annotation directly declared on the object.
|
boolean |
hasDeclaredStereotype(java.lang.String annotation)
Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parent
|
boolean |
hasPropertyExpressions()
Does the metadata contain any property expressions like
${foo.bar} . |
boolean |
hasStereotype(java.lang.String annotation)
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
|
java.util.OptionalInt |
intValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The value as an
OptionalInt for the given annotation and member. |
java.util.OptionalInt |
intValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the int value and optionally map its value.
|
java.util.OptionalInt |
intValue(java.lang.String annotation,
java.lang.String member)
The value as an
OptionalInt for the given annotation and member. |
java.util.OptionalInt |
intValue(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the int value and optionally map its value.
|
boolean |
isEmpty()
Is the annotation metadata empty.
|
boolean |
isFalse(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
Returns whether the value of the given member is true.
|
boolean |
isPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
Returns whether the value of the given member is present.
|
boolean |
isRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Is repeatable annotation?
|
boolean |
isRepeatableAnnotation(java.lang.String annotation)
Is repeatable annotation?
|
boolean |
isTrue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
Returns whether the value of the given member is true.
|
boolean |
isTrue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
boolean |
isTrue(java.lang.String annotation,
java.lang.String member)
Returns whether the value of the given member is true.
|
boolean |
isTrue(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
java.util.Iterator<AnnotationMetadata> |
iterator() |
java.util.OptionalLong |
longValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The value as an
OptionalLong for the given annotation and member. |
java.util.OptionalLong |
longValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the long value and optionally map its value.
|
java.util.OptionalLong |
longValue(java.lang.String annotation,
java.lang.String member)
The value as an
OptionalLong for the given annotation and member. |
java.util.OptionalLong |
longValue(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the long value and optionally map its value.
|
java.util.Optional<java.lang.String> |
stringValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The value as an optional string for the given annotation and member.
|
java.util.Optional<java.lang.String> |
stringValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.
|
java.util.Optional<java.lang.String> |
stringValue(java.lang.String annotation,
java.lang.String member)
The value as an optional string for the given annotation and member.
|
java.util.Optional<java.lang.String> |
stringValue(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.
|
java.lang.String[] |
stringValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member)
The values as string array for the given annotation and member.
|
java.lang.String[] |
stringValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.
|
java.lang.String[] |
stringValues(java.lang.String annotation,
java.lang.String member)
The values as string array for the given annotation and member.
|
java.lang.String[] |
stringValues(java.lang.String annotation,
java.lang.String member,
java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
Retrieve the string value and optionally map its value.
|
<T extends java.lang.annotation.Annotation> |
synthesize(java.lang.Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
<T extends java.lang.annotation.Annotation> |
synthesize(java.lang.Class<T> annotationClass,
java.lang.String sourceAnnotation)
Synthesizes a new annotation for the given annotation type using the member values of the given source annotation.
|
java.lang.annotation.Annotation[] |
synthesizeAll()
Synthesizes a new annotations from the metadata.
|
<T extends java.lang.annotation.Annotation> |
synthesizeAnnotationsByType(java.lang.Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
java.lang.annotation.Annotation[] |
synthesizeDeclared()
Synthesizes a new annotations from the metadata.
|
<T extends java.lang.annotation.Annotation> |
synthesizeDeclared(java.lang.Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
<T extends java.lang.annotation.Annotation> |
synthesizeDeclared(java.lang.Class<T> annotationClass,
java.lang.String sourceAnnotation)
Synthesizes a new annotation declared for the given annotation type using the member values of the given source annotation.
|
<T extends java.lang.annotation.Annotation> |
synthesizeDeclaredAnnotationsByType(java.lang.Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
booleanValue, booleanValue, classValue, classValue, classValues, classValues, doubleValue, enumValue, enumValue, enumValues, enumValues, findAnnotation, findDeclaredAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNamesByStereotype, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDefaultValue, getDefaultValue, getDefaultValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, intValue, isAnnotationPresent, isAnnotationPresent, isDeclaredAnnotationPresent, isDeclaredAnnotationPresent, isFalse, isPresent, stringValue, stringValue, stringValues, stringValues
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation
public static final AnnotationMetadata[] EMPTY_HIERARCHY
public AnnotationMetadataHierarchy(AnnotationMetadata... hierarchy)
hierarchy
- The annotation hierarchypublic boolean hasPropertyExpressions()
AnnotationMetadata
${foo.bar}
. Note
this by default returns true
as previous versions of Micronaut must assume metadata
is present. The compilation time this is computed in order to decide whether to instrument
annotation metadata with environment specific logic.hasPropertyExpressions
in interface AnnotationMetadata
public java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getAnnotationType(@NonNull java.lang.String name)
AnnotationMetadata
getAnnotationType
in interface AnnotationMetadata
name
- The type namepublic java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getAnnotationType(@NonNull java.lang.String name, @NonNull java.lang.ClassLoader classLoader)
AnnotationMetadata
getAnnotationType
in interface AnnotationMetadata
name
- The type nameclassLoader
- The ClassLoader to load the type@NonNull public AnnotationMetadata getDeclaredMetadata()
AnnotationMetadata
getDeclaredMetadata
in interface AnnotationMetadata
@NonNull public AnnotationMetadata getRootMetadata()
@NonNull public AnnotationMetadata createSibling(@NonNull AnnotationMetadata child)
child
- The child annotation metadata@Nullable public <T extends java.lang.annotation.Annotation> T synthesize(@NonNull java.lang.Class<T> annotationClass, @NonNull java.lang.String sourceAnnotation)
AnnotationSource
This method allows supporting synthesizing annotations that have been renamed, for example a jakarta.inject.Named
annotation an be synthesized from the metadata of the a javax.inject.Named
annotation.
synthesize
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation classsourceAnnotation
- The source annotation that provides the member valuespublic java.lang.annotation.Annotation[] synthesizeAll()
AnnotationSource
synthesizeAll
in interface AnnotationSource
public java.lang.annotation.Annotation[] synthesizeDeclared()
AnnotationSource
synthesizeDeclared
in interface AnnotationSource
public <T extends java.lang.annotation.Annotation> T[] synthesizeAnnotationsByType(java.lang.Class<T> annotationClass)
AnnotationSource
synthesizeAnnotationsByType
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation typepublic <T extends java.lang.annotation.Annotation> T[] synthesizeDeclaredAnnotationsByType(java.lang.Class<T> annotationClass)
AnnotationSource
synthesizeDeclaredAnnotationsByType
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation type@Nullable public <T extends java.lang.annotation.Annotation> T synthesizeDeclared(@NonNull java.lang.Class<T> annotationClass, @NonNull java.lang.String sourceAnnotation)
AnnotationSource
This method allows supporting synthesizing annotations that have been renamed, for example a jakarta.inject.Named
annotation an be synthesized from the metadata of the a javax.inject.Named
annotation.
synthesizeDeclared
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation classsourceAnnotation
- The source annotation that provides the member values@Nullable public <T extends java.lang.annotation.Annotation> T synthesize(@NonNull java.lang.Class<T> annotationClass)
AnnotationSource
synthesize
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation class@Nullable public <T extends java.lang.annotation.Annotation> T synthesizeDeclared(@NonNull java.lang.Class<T> annotationClass)
AnnotationSource
This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
synthesizeDeclared
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation class@NonNull public <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findAnnotation(@NonNull java.lang.String annotation)
AnnotationSource
AnnotationValue
for the given annotation name.findAnnotation
in interface AnnotationSource
T
- The annotation typeannotation
- The annotation nameAnnotationValue
instance@NonNull public <T extends java.lang.annotation.Annotation> java.util.Optional<AnnotationValue<T>> findDeclaredAnnotation(@NonNull java.lang.String annotation)
AnnotationSource
findDeclaredAnnotation
in interface AnnotationSource
T
- The annotation typeannotation
- The annotation nameAnnotationValue
instance@NonNull public java.util.OptionalDouble doubleValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
AnnotationMetadata
OptionalDouble
for the given annotation and member.doubleValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalDouble
value@NonNull public java.lang.String[] stringValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member)
AnnotationMetadata
stringValues
in interface AnnotationMetadata
annotation
- The annotationmember
- The member@NonNull public java.lang.String[] stringValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
stringValues
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic java.util.Optional<java.lang.Boolean> booleanValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
booleanValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic boolean isTrue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
isTrue
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation memberpublic java.util.OptionalLong longValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
OptionalLong
for the given annotation and member.longValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalLong
valuepublic java.util.Optional<java.lang.String> stringValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
stringValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic java.util.OptionalInt intValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
OptionalInt
for the given annotation and member.intValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalInt
value@NonNull public java.util.OptionalDouble doubleValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
OptionalDouble
for the given annotation and member.doubleValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalDouble
valuepublic <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType)
AnnotationMetadata
enumValue
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typeOptional
class@NonNull public <T> java.lang.Class<T>[] classValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
classValues
in interface AnnotationMetadata
T
- The type of the classannotation
- The annotationmember
- The annotation memberOptional
classpublic java.util.Optional<java.lang.Class> classValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member)
AnnotationMetadata
classValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The annotation memberOptional
class@NonNull public java.util.List<java.lang.String> getAnnotationNamesByStereotype(@Nullable java.lang.String stereotype)
AnnotationMetadata
getAnnotationNamesByStereotype
in interface AnnotationMetadata
stereotype
- The annotation names@NonNull public java.util.Set<java.lang.String> getDeclaredAnnotationNames()
AnnotationMetadata
getDeclaredAnnotationNames
in interface AnnotationMetadata
@NonNull public java.util.Set<java.lang.String> getAnnotationNames()
AnnotationMetadata
getAnnotationNames
in interface AnnotationMetadata
@NonNull public <T> OptionalValues<T> getValues(@NonNull java.lang.String annotation, @NonNull java.lang.Class<T> valueType)
AnnotationMetadata
getValues
in interface AnnotationMetadata
T
- Generic typeannotation
- The annotation namevalueType
- valueTypeOptionalValues
public <T> java.util.Optional<T> getDefaultValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @NonNull Argument<T> requiredType)
AnnotationMetadata
getDefaultValue
in interface AnnotationMetadata
T
- The required generic typeannotation
- The annotationmember
- The memberrequiredType
- The required type@NonNull public <T extends java.lang.annotation.Annotation> java.util.List<AnnotationValue<T>> getAnnotationValuesByType(@NonNull java.lang.Class<T> annotationType)
AnnotationMetadata
getAnnotationValuesByType
in interface AnnotationMetadata
T
- The annotation typeannotationType
- The annotation type@NonNull public <T extends java.lang.annotation.Annotation> java.util.List<AnnotationValue<T>> getDeclaredAnnotationValuesByType(@NonNull java.lang.Class<T> annotationType)
AnnotationMetadata
getDeclaredAnnotationValuesByType
in interface AnnotationMetadata
T
- The annotation typeannotationType
- The annotation typepublic boolean hasDeclaredAnnotation(@Nullable java.lang.String annotation)
AnnotationMetadata
hasDeclaredAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic boolean hasAnnotation(@Nullable java.lang.String annotation)
AnnotationMetadata
hasAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic boolean hasStereotype(@Nullable java.lang.String annotation)
AnnotationMetadata
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
.
An annotation stereotype is a meta annotation potentially applied to another annotation
hasStereotype
in interface AnnotationMetadata
annotation
- The annotationpublic boolean hasDeclaredStereotype(@Nullable java.lang.String annotation)
AnnotationMetadata
Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parent
.
An annotation stereotype is a meta annotation potentially applied to another annotation
hasDeclaredStereotype
in interface AnnotationMetadata
annotation
- The annotationpublic <E extends java.lang.Enum> java.util.Optional<E> enumValue(java.lang.String annotation, java.lang.String member, java.lang.Class<E> enumType)
AnnotationMetadata
enumValue
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typeOptional
classpublic <E extends java.lang.Enum> E[] enumValues(java.lang.String annotation, java.lang.String member, java.lang.Class<E> enumType)
AnnotationMetadata
enumValues
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typepublic java.util.OptionalInt intValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
OptionalInt
for the given annotation and member.intValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalInt
valuepublic boolean isFalse(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
isFalse
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation member@NonNull public java.util.Map<java.lang.String,java.lang.Object> getDefaultValues(@NonNull java.lang.String annotation)
AnnotationMetadata
getDefaultValues
in interface AnnotationMetadata
annotation
- The annotation namepublic <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic <E extends java.lang.Enum> java.util.Optional<E> enumValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic <E extends java.lang.Enum> E[] enumValues(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.lang.Class<E> enumType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic java.util.Optional<java.lang.Class> classValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic java.util.Optional<java.lang.Class> classValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic java.util.OptionalInt intValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic java.util.Optional<java.lang.Boolean> booleanValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public java.util.Optional<java.lang.Boolean> booleanValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic java.util.OptionalLong longValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public java.util.OptionalLong longValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public java.util.OptionalInt intValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic java.util.OptionalLong longValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
OptionalLong
for the given annotation and member.longValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalLong
valuepublic <E extends java.lang.Enum> E[] enumValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member, java.lang.Class<E> enumType)
AnnotationMetadata
enumValues
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typepublic <T> java.lang.Class<T>[] classValues(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
classValues
in interface AnnotationMetadata
T
- The type of the classannotation
- The annotationmember
- The annotation memberOptional
classpublic java.util.Optional<java.lang.Class> classValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
classValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The annotation memberOptional
classpublic java.util.Optional<java.lang.String> stringValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
stringValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic java.util.Optional<java.lang.Boolean> booleanValue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
booleanValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic boolean isTrue(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
isTrue
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation memberpublic boolean isPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.String member)
AnnotationMetadata
isPresent
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation memberpublic java.util.Optional<java.lang.String> stringValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public java.lang.String[] stringValues(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic java.lang.String[] stringValues(java.lang.String annotation, java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public java.util.Optional<java.lang.String> stringValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic boolean isTrue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic boolean isTrue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic java.util.OptionalDouble doubleValue(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotation, @NonNull java.lang.String member, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public java.util.OptionalDouble doubleValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public <T> java.util.Optional<T> getValue(@NonNull java.lang.String annotation, @NonNull java.lang.String member, @NonNull Argument<T> requiredType, @Nullable java.util.function.Function<java.lang.Object,java.lang.Object> valueMapper)
T
- The generic typeannotation
- The annotationmember
- The memberrequiredType
- The required typevalueMapper
- The value mapper@NonNull public java.util.Iterator<AnnotationMetadata> iterator()
iterator
in interface java.lang.Iterable<AnnotationMetadata>
public boolean isEmpty()
AnnotationMetadata
isEmpty
in interface AnnotationMetadata
public boolean isRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
AnnotationMetadata
isRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic boolean isRepeatableAnnotation(java.lang.String annotation)
AnnotationMetadata
isRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic java.util.Optional<java.lang.String> findRepeatableAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
AnnotationMetadata
findRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic java.util.Optional<java.lang.String> findRepeatableAnnotation(java.lang.String annotation)
AnnotationMetadata
findRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotation