Package io.micronaut.inject.annotation
Class AbstractEnvironmentAnnotationMetadata
java.lang.Object
io.micronaut.inject.annotation.AbstractEnvironmentAnnotationMetadata
- All Implemented Interfaces:
AnnotationMetadata
,AnnotationSource
@Internal
public abstract class AbstractEnvironmentAnnotationMetadata
extends Object
implements AnnotationMetadata
Variation of
AnnotationMetadata
that is environment specific.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractEnvironmentAnnotationMetadata
(AnnotationMetadata targetMetadata) Construct a new environment aware annotation metadata. -
Method Summary
Modifier and TypeMethodDescriptionbooleanValue
(@NonNull Class<? extends Annotation> annotation, @NonNull String member) The value as an optional boolean for the given annotation and member.booleanValue
(@NonNull String annotation, @NonNull String member) The value as an optional boolean for the given annotation and member.classValue
(@NonNull Class<? extends Annotation> annotation, @NonNull String member) The value of the annotation as a Class.classValue
(@NonNull String annotation, @NonNull String member) The value of the annotation as a Class.<T> Class<T>[]
classValues
(@NonNull Class<? extends Annotation> annotation, @NonNull String member) The value of the annotation as a Class.<T> Class<T>[]
classValues
(@NonNull String annotation, @NonNull String member) The value of the annotation as a Class.Makes a copy of the annotation or returns this.doubleValue
(@NonNull Class<? extends Annotation> annotation, @NonNull String member) The value as anOptionalDouble
for the given annotation and member.doubleValue
(@NonNull String annotation, @NonNull String member) The value as anOptionalDouble
for the given annotation and member.enumValue
(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType) The value of the annotation as a Class.The value of the annotation as a Class.<E extends Enum<E>>
E[]The enum values for the given annotation.<T extends Annotation>
@NonNull Optional<AnnotationValue<T>>findAnnotation
(@NonNull String annotation) Find anAnnotationValue
for the given annotation name.<T extends Annotation>
@NonNull Optional<AnnotationValue<T>>findDeclaredAnnotation
(@NonNull String annotation) Get all values for the given annotation that are directly declared on the annotated element.All the annotation names this metadata declares.getAnnotationNamesByStereotype
(String stereotype) Resolve all annotation names that feature the given stereotype.@NonNull Optional<Class<? extends Annotation>>
getAnnotationType
(@NonNull String name) Gets the type for a given annotation if it is present on the classpath.@NonNull Optional<Class<? extends Annotation>>
getAnnotationType
(@NonNull String name, @NonNull ClassLoader classLoader) Gets the type for a given annotation if it is present on the classpath.@NonNull Optional<Class<? extends Annotation>>
getAnnotationTypeByStereotype
(@NonNull Class<? extends Annotation> stereotype) Find the first annotation name for the given stereotype.@NonNull Optional<Class<? extends Annotation>>
getAnnotationTypeByStereotype
(@Nullable String stereotype) Find the first annotation name for the given stereotype.<T extends Annotation>
@NonNull List<AnnotationValue<T>>getAnnotationValuesByType
(@NonNull Class<T> annotationType) Gets all the annotation values by the given repeatable type.All the declared annotation names this metadata declares.getDeclaredAnnotationNamesByStereotype
(String stereotype) Resolve all annotations names for the given stereotype that are declared annotations.<T extends Annotation>
@NonNull List<AnnotationValue<T>>getDeclaredAnnotationValuesByType
(@NonNull Class<T> annotationType) Gets only declared annotation values by the given repeatable type.getDefaultValue
(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType) Return the default value for the given annotation member.Return the default value for the given annotation member.protected abstract @Nullable Environment
Resolves theEnvironment
for this metadata.Unwraps possible a possible delegate or a provider, returns this otherwise.<T> Optional<T>
Get the value of the given annotation member.<T> @NonNull OptionalValues<T>
Get all values for the given annotation and type of the underlying values.boolean
hasAnnotation
(@Nullable String annotation) Checks whether this object has the given annotation on the object itself or inherited from a parent.boolean
hasDeclaredAnnotation
(@Nullable String annotation) Checks whether this object has the given annotation directly declared on the object.boolean
hasDeclaredStereotype
(@Nullable String annotation) Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parentboolean
Does the metadata contain any evaluated expressions like#{ T(java.lang.Math).random() }
.boolean
hasStereotype
(@Nullable String annotation) Checks whether this object has the given annotation stereotype on the object itself or inherited from a parentThe value as anOptionalInt
for the given annotation and member.The value as anOptionalInt
for the given annotation and member.boolean
Returns whether the value of the given member is true.boolean
Returns whether the value of the given member is true.boolean
Returns whether the value of the given member is true.boolean
Returns whether the value of the given member is true.The value as anOptionalLong
for the given annotation and member.The value as anOptionalLong
for the given annotation and member.stringValue
(@NonNull Class<? extends Annotation> annotation, @NonNull String member) The value as an optional string for the given annotation and member.stringValue
(@NonNull String annotation, @NonNull String member) The value as an optional string for the given annotation and member.stringValues
(@NonNull Class<? extends Annotation> annotation, @NonNull String member) The values as string array for the given annotation and member.<T extends Annotation>
Tsynthesize
(@NonNull Class<T> annotationClass) Synthesizes a new annotation from the metadata for the given annotation type.<T extends Annotation>
@NonNull T[]synthesizeAnnotationsByType
(@NonNull Class<T> annotationClass) Synthesizes a new annotations from the metadata for the given type.<T extends Annotation>
TsynthesizeDeclared
(@NonNull Class<T> annotationClass) Synthesizes a new annotation from the metadata for the given annotation type.<T extends Annotation>
@NonNull T[]synthesizeDeclaredAnnotationsByType
(@NonNull Class<T> annotationClass) Synthesizes a new annotations from the metadata for the given type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
booleanValue, booleanValue, classValue, classValue, classValues, classValues, doubleValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValuesSet, enumValuesSet, findAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNamesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotypeNonRepeating, intValue, isAnnotationPresent, isAnnotationPresent, isDeclaredAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, stringValue, stringValue, stringValues, stringValues, stringValues
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, synthesize, synthesizeAll, synthesizeDeclared, synthesizeDeclared
-
Constructor Details
-
AbstractEnvironmentAnnotationMetadata
Construct a new environment aware annotation metadata.- Parameters:
targetMetadata
- The target annotation metadata
-
-
Method Details
-
getAnnotationMetadata
- Returns:
- The backing annotation metadata
-
synthesize
Description copied from interface:AnnotationSource
Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesize
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation class- Returns:
- The annotation or null if it doesn't exist
-
synthesizeDeclared
@Nullable public <T extends Annotation> T synthesizeDeclared(@NonNull @NonNull Class<T> annotationClass) Description copied from interface:AnnotationSource
Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
- Specified by:
synthesizeDeclared
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation class- Returns:
- The annotation or null if it doesn't exist
-
hasEvaluatedExpressions
public boolean hasEvaluatedExpressions()Description copied from interface:AnnotationMetadata
Does the metadata contain any evaluated expressions like#{ T(java.lang.Math).random() }
.- Specified by:
hasEvaluatedExpressions
in interfaceAnnotationMetadata
- Returns:
- True if evaluated expressions are present
-
getValue
public <T> Optional<T> getValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, @NonNull @NonNull Argument<T> requiredType) Description copied from interface:AnnotationMetadata
Get the value of the given annotation member.- Specified by:
getValue
in interfaceAnnotationMetadata
- Type Parameters:
T
- The value- Parameters:
annotation
- The annotation classmember
- The annotation memberrequiredType
- The required type- Returns:
- An
Optional
of the value
-
classValues
public <T> Class<T>[] classValues(@NonNull @NonNull String annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value of the annotation as a Class.- Specified by:
classValues
in interfaceAnnotationMetadata
- Type Parameters:
T
- The type of the class- Parameters:
annotation
- The annotationmember
- The annotation member- Returns:
- An
Optional
class
-
classValues
public <T> Class<T>[] classValues(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value of the annotation as a Class.- Specified by:
classValues
in interfaceAnnotationMetadata
- Type Parameters:
T
- The type of the class- Parameters:
annotation
- The annotationmember
- The annotation member- Returns:
- An
Optional
class
-
isTrue
Description copied from interface:AnnotationMetadata
Returns whether the value of the given member is true.- Specified by:
isTrue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation classmember
- The annotation member- Returns:
- True if the value is true
-
isFalse
Description copied from interface:AnnotationMetadata
Returns whether the value of the given member is true.- Specified by:
isFalse
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation classmember
- The annotation member- Returns:
- True if the value is true
-
getAnnotationTypeByStereotype
@NonNull public @NonNull Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@NonNull @NonNull Class<? extends Annotation> stereotype) Description copied from interface:AnnotationMetadata
Find the first annotation name for the given stereotype.- Specified by:
getAnnotationTypeByStereotype
in interfaceAnnotationMetadata
- Parameters:
stereotype
- The stereotype- Returns:
- The annotation name
-
getAnnotationTypeByStereotype
@NonNull public @NonNull Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@Nullable @Nullable String stereotype) Description copied from interface:AnnotationMetadata
Find the first annotation name for the given stereotype.- Specified by:
getAnnotationTypeByStereotype
in interfaceAnnotationMetadata
- Parameters:
stereotype
- The stereotype- Returns:
- The annotation name
-
classValue
@NonNull public @NonNull Optional<Class> classValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value of the annotation as a Class.- Specified by:
classValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The annotation member- Returns:
- An
Optional
class
-
classValue
@NonNull public @NonNull Optional<Class> classValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value of the annotation as a Class.- Specified by:
classValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The annotation member- Returns:
- An
Optional
class
-
enumValue
public <E extends Enum<E>> Optional<E> enumValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, Class<E> enumType) Description copied from interface:AnnotationMetadata
The value of the annotation as a Class.- Specified by:
enumValue
in interfaceAnnotationMetadata
- Type Parameters:
E
- The enum type- Parameters:
annotation
- The annotationmember
- The annotation memberenumType
- The enum type- Returns:
- An
Optional
class
-
enumValue
public <E extends Enum<E>> Optional<E> enumValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member, Class<E> enumType) Description copied from interface:AnnotationMetadata
The value of the annotation as a Class.- Specified by:
enumValue
in interfaceAnnotationMetadata
- Type Parameters:
E
- The enum type- Parameters:
annotation
- The annotationmember
- The annotation memberenumType
- The enum type- Returns:
- An
Optional
class
-
enumValues
public <E extends Enum<E>> E[] enumValues(@NonNull @NonNull String annotation, @NonNull @NonNull String member, Class<E> enumType) Description copied from interface:AnnotationMetadata
The enum values for the given annotation.- Specified by:
enumValues
in interfaceAnnotationMetadata
- Type Parameters:
E
- The enum type- Parameters:
annotation
- The annotationmember
- The annotation memberenumType
- The enum type- Returns:
- An array of enum values
-
booleanValue
public Optional<Boolean> booleanValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as an optional boolean for the given annotation and member.- Specified by:
booleanValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- The string value if it is present
-
booleanValue
public Optional<Boolean> booleanValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as an optional boolean for the given annotation and member.- Specified by:
booleanValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- The string value if it is present
-
stringValue
@NonNull public @NonNull Optional<String> stringValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as an optional string for the given annotation and member.- Specified by:
stringValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- The string value if it is present
-
stringValues
@NonNull public @NonNull String[] stringValues(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The values as string array for the given annotation and member.- Specified by:
stringValues
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- The string values if it is present
-
stringValue
@NonNull public @NonNull Optional<String> stringValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as an optional string for the given annotation and member.- Specified by:
stringValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- The string value if it is present
-
longValue
Description copied from interface:AnnotationMetadata
The value as anOptionalLong
for the given annotation and member.- Specified by:
longValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- THe
OptionalLong
value
-
longValue
public OptionalLong longValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as anOptionalLong
for the given annotation and member.- Specified by:
longValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- THe
OptionalLong
value
-
intValue
@NonNull public @NonNull OptionalInt intValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as anOptionalInt
for the given annotation and member.- Specified by:
intValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- THe
OptionalInt
value
-
intValue
@NonNull public @NonNull OptionalInt intValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as anOptionalInt
for the given annotation and member.- Specified by:
intValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- THe
OptionalInt
value
-
doubleValue
@NonNull public @NonNull OptionalDouble doubleValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as anOptionalDouble
for the given annotation and member.- Specified by:
doubleValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- THe
OptionalDouble
value
-
doubleValue
@NonNull public @NonNull OptionalDouble doubleValue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
The value as anOptionalDouble
for the given annotation and member.- Specified by:
doubleValue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotationmember
- The member- Returns:
- THe
OptionalDouble
value
-
isTrue
public boolean isTrue(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
Returns whether the value of the given member is true.- Specified by:
isTrue
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation classmember
- The annotation member- Returns:
- True if the value is true
-
isFalse
public boolean isFalse(@NonNull @NonNull Class<? extends Annotation> annotation, @NonNull @NonNull String member) Description copied from interface:AnnotationMetadata
Returns whether the value of the given member is true.- Specified by:
isFalse
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation classmember
- The annotation member- Returns:
- True if the value is true
-
getAnnotationType
@NonNull public @NonNull Optional<Class<? extends Annotation>> getAnnotationType(@NonNull @NonNull String name) Description copied from interface:AnnotationMetadata
Gets the type for a given annotation if it is present on the classpath. Subclasses can potentially override to provide optimized loading.- Specified by:
getAnnotationType
in interfaceAnnotationMetadata
- Parameters:
name
- The type name- Returns:
- The type if present
-
getAnnotationType
@NonNull public @NonNull Optional<Class<? extends Annotation>> getAnnotationType(@NonNull @NonNull String name, @NonNull @NonNull ClassLoader classLoader) Description copied from interface:AnnotationMetadata
Gets the type for a given annotation if it is present on the classpath. Subclasses can potentially override to provide optimized loading.- Specified by:
getAnnotationType
in interfaceAnnotationMetadata
- Parameters:
name
- The type nameclassLoader
- The ClassLoader to load the type- Returns:
- The type if present
-
getAnnotationValuesByType
@NonNull public <T extends Annotation> @NonNull List<AnnotationValue<T>> getAnnotationValuesByType(@NonNull @NonNull Class<T> annotationType) Description copied from interface:AnnotationMetadata
Gets all the annotation values by the given repeatable type.- Specified by:
getAnnotationValuesByType
in interfaceAnnotationMetadata
- Type Parameters:
T
- The annotation type- Parameters:
annotationType
- The annotation type- Returns:
- A list of values
-
getDeclaredAnnotationValuesByType
@NonNull public <T extends Annotation> @NonNull List<AnnotationValue<T>> getDeclaredAnnotationValuesByType(@NonNull @NonNull Class<T> annotationType) Description copied from interface:AnnotationMetadata
Gets only declared annotation values by the given repeatable type.- Specified by:
getDeclaredAnnotationValuesByType
in interfaceAnnotationMetadata
- Type Parameters:
T
- The annotation type- Parameters:
annotationType
- The annotation type- Returns:
- A list of values
-
synthesizeAnnotationsByType
@NonNull public <T extends Annotation> @NonNull T[] synthesizeAnnotationsByType(@NonNull @NonNull Class<T> annotationClass) Description copied from interface:AnnotationSource
Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesizeAnnotationsByType
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation type- Returns:
- All annotations by the given type
-
synthesizeDeclaredAnnotationsByType
@NonNull public <T extends Annotation> @NonNull T[] synthesizeDeclaredAnnotationsByType(@NonNull @NonNull Class<T> annotationClass) Description copied from interface:AnnotationSource
Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesizeDeclaredAnnotationsByType
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation type- Returns:
- Declared annotations by the given type
-
hasDeclaredAnnotation
Description copied from interface:AnnotationMetadata
Checks whether this object has the given annotation directly declared on the object.- Specified by:
hasDeclaredAnnotation
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation- Returns:
- True if the annotation is present
-
hasAnnotation
Description copied from interface:AnnotationMetadata
Checks whether this object has the given annotation on the object itself or inherited from a parent.- Specified by:
hasAnnotation
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation- Returns:
- True if the annotation is present
-
hasStereotype
Description copied from interface: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
- Specified by:
hasStereotype
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation- Returns:
- True if the annotation is present
-
hasDeclaredStereotype
Description copied from interface: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
- Specified by:
hasDeclaredStereotype
in interfaceAnnotationMetadata
- Parameters:
annotation
- The annotation- Returns:
- True if the annotation is present
-
getAnnotationNamesByStereotype
Description copied from interface:AnnotationMetadata
Resolve all annotation names that feature the given stereotype.- Specified by:
getAnnotationNamesByStereotype
in interfaceAnnotationMetadata
- Parameters:
stereotype
- The annotation names- Returns:
- A set of annotation names
-
getAnnotationNames
Description copied from interface:AnnotationMetadata
All the annotation names this metadata declares.- Specified by:
getAnnotationNames
in interfaceAnnotationMetadata
- Returns:
- All the annotation names this metadata declares
-
getDeclaredAnnotationNames
Description copied from interface:AnnotationMetadata
All the declared annotation names this metadata declares.- Specified by:
getDeclaredAnnotationNames
in interfaceAnnotationMetadata
- Returns:
- All the declared annotation names this metadata declares
-
getDeclaredAnnotationNamesByStereotype
Description copied from interface:AnnotationMetadata
Resolve all annotations names for the given stereotype that are declared annotations.- Specified by:
getDeclaredAnnotationNamesByStereotype
in interfaceAnnotationMetadata
- Parameters:
stereotype
- The stereotype- Returns:
- The declared annotations
-
findAnnotation
@NonNull public <T extends Annotation> @NonNull Optional<AnnotationValue<T>> findAnnotation(@NonNull @NonNull String annotation) Description copied from interface:AnnotationSource
Find anAnnotationValue
for the given annotation name.- Specified by:
findAnnotation
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation type- Parameters:
annotation
- The annotation name- Returns:
- A
AnnotationValue
instance
-
findDeclaredAnnotation
@NonNull public <T extends Annotation> @NonNull Optional<AnnotationValue<T>> findDeclaredAnnotation(@NonNull @NonNull String annotation) Description copied from interface:AnnotationSource
Get all values for the given annotation that are directly declared on the annotated element.- Specified by:
findDeclaredAnnotation
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation type- Parameters:
annotation
- The annotation name- Returns:
- A
AnnotationValue
instance
-
getValues
@NonNull public <T> @NonNull OptionalValues<T> getValues(@NonNull @NonNull String annotation, @NonNull @NonNull Class<T> valueType) Description copied from interface:AnnotationMetadata
Get all values for the given annotation and type of the underlying values.- Specified by:
getValues
in interfaceAnnotationMetadata
- Type Parameters:
T
- Generic type- Parameters:
annotation
- The annotation namevalueType
- valueType- Returns:
- The
OptionalValues
-
getDefaultValue
@NonNull public <T> @NonNull Optional<T> getDefaultValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, @NonNull @NonNull Class<T> requiredType) Description copied from interface:AnnotationMetadata
Return the default value for the given annotation member.- Specified by:
getDefaultValue
in interfaceAnnotationMetadata
- Type Parameters:
T
- The required generic type- Parameters:
annotation
- The annotationmember
- The memberrequiredType
- The required type- Returns:
- An optional value
-
getDefaultValue
@NonNull public <T> @NonNull Optional<T> getDefaultValue(@NonNull @NonNull String annotation, @NonNull @NonNull String member, @NonNull @NonNull Argument<T> requiredType) Description copied from interface:AnnotationMetadata
Return the default value for the given annotation member.- Specified by:
getDefaultValue
in interfaceAnnotationMetadata
- Type Parameters:
T
- The required generic type- Parameters:
annotation
- The annotationmember
- The memberrequiredType
- The required type- Returns:
- An optional value
-
copyAnnotationMetadata
Description copied from interface:AnnotationMetadata
Makes a copy of the annotation or returns this.- Specified by:
copyAnnotationMetadata
in interfaceAnnotationMetadata
- Returns:
- the copy
-
getTargetAnnotationMetadata
Description copied from interface:AnnotationMetadata
Unwraps possible a possible delegate or a provider, returns this otherwise.- Specified by:
getTargetAnnotationMetadata
in interfaceAnnotationMetadata
- Specified by:
getTargetAnnotationMetadata
in interfaceAnnotationSource
- Returns:
- unwrapped
- See Also:
-
getEnvironment
Resolves theEnvironment
for this metadata.- Returns:
- The metadata
-