Class AnnotationUtil
java.lang.Object
io.micronaut.core.annotation.AnnotationUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe adapter annotation type.static final StringThe around annotation type.static final StringThe around annotation type.static final StringThe inherited annotation.static final StringName of the interceptor binding type.static final StringName of the interceptor binding qualifier type.static final StringName of the repeatable interceptor bindings type.static final StringThe around annotation type.static final AnnotatedElementAn empty re-usable element.static final StringThe meta annotation used for inject declarations.static final StringConstant for Kotlin metadata.static final StringThe name of the required member.static final StringThe meta annotation used for named qualifiers.static final StringThe annotation attribute containing all the attributes marked as non-binding.static final StringSimple Annotation name used for non-null.static final StringSimple Annotation name used for nullable.static final StringThe meta annotation used for post-construct declarations.static final StringThe meta annotation used for pre-destroy declarations.static final StringThe meta annotation used for qualifier declarations.static final StringThe meta annotation used for scope declarations.static final StringThe meta annotation used for singleton scope.Packages excludes from stereotype processing.static final AnnotatedElement[]Constant indicating a zero annotation.static final AnnotationValue<?>[]Constant indicating a zero annotation values.static final Annotation[]Constant indicating a zero annotation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanComputes whether 2 annotation values are equal.static intcalculateHashCode(Map<? extends CharSequence, Object> values) Calculates the hash code of annotation values.findQualifierAnnotation(AnnotationMetadata annotationMetadata) Finds a qualifier annotation.static List<AnnotationValue<Annotation>> findQualifierAnnotations(AnnotationMetadata annotationMetadata) Finds qualifier annotations.findQualifierAnnotationsNames(AnnotationMetadata annotationMetadata) Finds qualifier annotations names.static booleanhasDeclaredQualifierAnnotation(AnnotationMetadata annotationMetadata) Has qualifier annotations.internListOf(Object... objects) Converts the given objects into a set of potentially cached and interned strings contained within an internal pool of lists.internMapOf(Object... values) Converts the given objects into a map of potentially cached and interned strings where the keys and values are alternating entries in the passed array.internMapOf(String key, Object value) Converts the given objects into a map of potentially cached and interned strings where the keys and values are alternating entries in the passed array.Create a new immutableMapfrom an array of values.Create a new immutableMap.Create a new immutableMap.Create a new immutableMap.mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4) Create a new immutableMap.mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5) Create a new immutableMap.mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6) Create a new immutableMap.mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7) Create a new immutableMap.mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7, String key8, Object value8) Create a new immutableMap.mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7, String key8, Object value8, String key9, Object value9) Create a new immutableMap.mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7, String key8, Object value8, String key9, Object value9, String key10, Object value10) Create a new immutableMap.static String[]resolveNonBindingMembers(AnnotationMetadata annotationMetadata) Resolve non-binding members.
-
Field Details
-
KOTLIN_METADATA
-
INTERNAL_ANNOTATION_NAMES
-
STEREOTYPE_EXCLUDES
-
ZERO_ANNOTATIONS
Constant indicating a zero annotation. -
ZERO_ANNOTATED_ELEMENTS
Constant indicating a zero annotation. -
ZERO_ANNOTATION_VALUES
Constant indicating a zero annotation values. -
EMPTY_ANNOTATED_ELEMENT
An empty re-usable element. -
NULLABLE
-
NON_NULL
-
ANN_AROUND
-
ANN_AROUND_CONSTRUCT
-
ANN_INTRODUCTION
-
ANN_ADAPTER
-
ANN_INTERCEPTOR_BINDING
-
ANN_INTERCEPTOR_BINDING_QUALIFIER
Name of the interceptor binding qualifier type.- See Also:
-
ANN_INTERCEPTOR_BINDINGS
Name of the repeatable interceptor bindings type.- See Also:
-
INJECT
-
SCOPE
-
SINGLETON
-
QUALIFIER
-
NAMED
-
PRE_DESTROY
The meta annotation used for pre-destroy declarations.- See Also:
-
POST_CONSTRUCT
The meta annotation used for post-construct declarations.- See Also:
-
NON_BINDING_ATTRIBUTE
The annotation attribute containing all the attributes marked as non-binding.- See Also:
-
ANN_INHERITED
The inherited annotation. -
MEMBER_REQUIRED
-
-
Constructor Details
-
AnnotationUtil
public AnnotationUtil()
-
-
Method Details
-
findQualifierAnnotations
public static List<AnnotationValue<Annotation>> findQualifierAnnotations(AnnotationMetadata annotationMetadata) Finds qualifier annotations.- Parameters:
annotationMetadata- The annotation metadata- Returns:
- The qualifier annotations
- Since:
- 4.0.0
-
findQualifierAnnotationsNames
Finds qualifier annotations names.- Parameters:
annotationMetadata- The annotation metadata- Returns:
- The qualifier annotations names
- Since:
- 4.0.0
-
hasDeclaredQualifierAnnotation
Has qualifier annotations.- Parameters:
annotationMetadata- The annotation metadata- Returns:
- True if qualifier annotation
- Since:
- 4.0.0
-
resolveNonBindingMembers
Resolve non-binding members.- Parameters:
annotationMetadata- The annotation metadata- Returns:
- The non-binding members
- Since:
- 4.0.0
-
findQualifierAnnotation
Finds a qualifier annotation.- Parameters:
annotationMetadata- The annotation metadata- Returns:
- A qualifier annotation
- Since:
- 4.0.0
-
internListOf
Converts the given objects into a set of potentially cached and interned strings contained within an internal pool of lists. SeeString.intern().This method serves the purpose of reducing memory footprint by pooling common lists of annotations in compiled
AnnotationMetadata- Parameters:
objects- The objects- Returns:
- Immutable, pooled set of strings
-
internMapOf
Converts the given objects into a map of potentially cached and interned strings where the keys and values are alternating entries in the passed array. SeeString.intern().The values stored at even number positions will be converted to strings and interned.
- Parameters:
values- The objects- Returns:
- An unmodifiable set of strings
- See Also:
-
internMapOf
Converts the given objects into a map of potentially cached and interned strings where the keys and values are alternating entries in the passed array. SeeString.intern().The values stored at even number positions will be converted to strings and interned.
- Parameters:
key- The keyvalue- The value- Returns:
- An unmodifiable set of strings
- Since:
- 3.0
-
mapOf
-
mapOf
-
mapOf
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3- Returns:
- The created map
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3key4- The key4value4- The value4- Returns:
- The created map
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3key4- The key4value4- The value4key5- The key5value5- The value5- Returns:
- The created map
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3key4- The key4value4- The value4key5- The key5value5- The value5key6- The key6value6- The value6- Returns:
- The created map
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3key4- The key4value4- The value4key5- The key5value5- The value5key6- The key6value6- The value6key7- The key7value7- The value7- Returns:
- The created map
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7, String key8, Object value8) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3key4- The key4value4- The value4key5- The key5value5- The value5key6- The key6value6- The value6key7- The key7value7- The value7key8- The key8value8- The value8- Returns:
- The created map
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7, String key8, Object value8, String key9, Object value9) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3key4- The key4value4- The value4key5- The key5value5- The value5key6- The key6value6- The value6key7- The key7value7- The value7key8- The key8value8- The value8key9- The key9value9- The value9- Returns:
- The created map
-
mapOf
public static Map<String,Object> mapOf(String key1, Object value1, String key2, Object value2, String key3, Object value3, String key4, Object value4, String key5, Object value5, String key6, Object value6, String key7, Object value7, String key8, Object value8, String key9, Object value9, String key10, Object value10) Create a new immutableMap. String values must be sorted!- Parameters:
key1- The key1value1- The value1key2- The key2value2- The value2key3- The key3value3- The value3key4- The key4value4- The value4key5- The key5value5- The value5key6- The key6value6- The value6key7- The key7value7- The value7key8- The key8value8- The value8key9- The key9value9- The value9key10- The key10value10- The value10- Returns:
- The created map
-
calculateHashCode
Calculates the hash code of annotation values.- Parameters:
values- The map to calculate values' hash code- Returns:
- The hash code
-
areEqual
-