/** * Build the actual {@link AnnotationValue}. * * @return The {@link AnnotationValue} */ public AnnotationValue<T> build() { return new AnnotationValue<>(annotationName, values); }
@SuppressWarnings("Duplicates") @Override public <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(String annotation) { if (declaredAnnotations != null && StringUtils.isNotEmpty(annotation)) { Map<CharSequence, Object> values = declaredAnnotations.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } else if (declaredStereotypes != null) { values = declaredStereotypes.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } } } return Optional.empty(); }
@SuppressWarnings("Duplicates") @Override public <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(String annotation) { if (allAnnotations != null && StringUtils.isNotEmpty(annotation)) { Map<CharSequence, Object> values = allAnnotations.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } else if (allStereotypes != null) { values = allStereotypes.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } } } return Optional.empty(); }
@SuppressWarnings("Duplicates") @Override public <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(String annotation) { if (allAnnotations != null && StringUtils.isNotEmpty(annotation)) { Map<CharSequence, Object> values = allAnnotations.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } else if (allStereotypes != null) { values = allStereotypes.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } } } return Optional.empty(); }
@SuppressWarnings("Duplicates") @Override public <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(String annotation) { if (declaredAnnotations != null && StringUtils.isNotEmpty(annotation)) { Map<CharSequence, Object> values = declaredAnnotations.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } else if (declaredStereotypes != null) { values = declaredStereotypes.get(annotation); if (values != null) { return Optional.of(new AnnotationValue<>(annotation, values, AnnotationMetadataSupport.getDefaultValues(annotation))); } } } return Optional.empty(); }
/** * @param annotationMirror The annotation * @return The annotation value */ protected io.micronaut.core.annotation.AnnotationValue readNestedAnnotationValue(A annotationMirror) { io.micronaut.core.annotation.AnnotationValue av; Map<? extends T, ?> annotationValues = readAnnotationRawValues(annotationMirror); if (annotationValues.isEmpty()) { av = new io.micronaut.core.annotation.AnnotationValue(getAnnotationTypeName(annotationMirror)); } else { Map<CharSequence, Object> resolvedValues = new LinkedHashMap<>(); for (Map.Entry<? extends T, ?> entry : annotationValues.entrySet()) { T member = entry.getKey(); OptionalValues<?> aliasForValues = getAnnotationValues(member, AliasFor.class); Object annotationValue = entry.getValue(); Optional<?> aliasMember = aliasForValues.get("member"); Optional<?> aliasAnnotation = aliasForValues.get("annotation"); Optional<?> aliasAnnotationName = aliasForValues.get("annotationName"); if (aliasMember.isPresent() && !(aliasAnnotation.isPresent() || aliasAnnotationName.isPresent())) { String aliasedNamed = aliasMember.get().toString(); readAnnotationRawValues(aliasedNamed, annotationValue, resolvedValues); } String memberName = getAnnotationMemberName(member); readAnnotationRawValues(memberName, annotationValue, resolvedValues); } av = new io.micronaut.core.annotation.AnnotationValue(getAnnotationTypeName(annotationMirror), resolvedValues); } return av; }
/** * @param annotationMirror The annotation * @return The annotation value */ protected io.micronaut.core.annotation.AnnotationValue readNestedAnnotationValue(A annotationMirror) { io.micronaut.core.annotation.AnnotationValue av; Map<? extends T, ?> annotationValues = readAnnotationRawValues(annotationMirror); if (annotationValues.isEmpty()) { av = new io.micronaut.core.annotation.AnnotationValue(getAnnotationTypeName(annotationMirror)); } else { Map<CharSequence, Object> resolvedValues = new LinkedHashMap<>(); for (Map.Entry<? extends T, ?> entry : annotationValues.entrySet()) { T member = entry.getKey(); OptionalValues<?> aliasForValues = getAnnotationValues(member, AliasFor.class); Object annotationValue = entry.getValue(); Optional<?> aliasMember = aliasForValues.get("member"); Optional<?> aliasAnnotation = aliasForValues.get("annotation"); if (aliasMember.isPresent() && !aliasAnnotation.isPresent()) { String aliasedNamed = aliasMember.get().toString(); readAnnotationRawValues(aliasedNamed, annotationValue, resolvedValues); } String memberName = getAnnotationMemberName(member); readAnnotationRawValues(memberName, annotationValue, resolvedValues); } av = new io.micronaut.core.annotation.AnnotationValue(getAnnotationTypeName(annotationMirror), resolvedValues); } return av; }
io.micronaut.core.annotation.AnnotationValue av = new io.micronaut.core.annotation.AnnotationValue(annotationName, data); if (isDeclared) { metadata.addDeclaredRepeatableStereotype(parents, repeatableName, av);
io.micronaut.core.annotation.AnnotationValue av = new io.micronaut.core.annotation.AnnotationValue(annotationName, data); if (isDeclared) { metadata.addDeclaredRepeatableStereotype(parents, repeatableName, av);
AnnotationValue<?> annotationValue = new AnnotationValue(annotationName, annotationValues); VisitorContext visitorContext = createVisitorContext(); for (AnnotationMapper mapper : mappers) {
io.micronaut.core.annotation.AnnotationValue av = new io.micronaut.core.annotation.AnnotationValue(annotationName, annotationValues); if (isDeclared) { annotationMetadata.addDeclaredRepeatable(repeatableName, av);
io.micronaut.core.annotation.AnnotationValue av = new io.micronaut.core.annotation.AnnotationValue(annotationName, annotationValues); if (isDeclared) { annotationMetadata.addDeclaredRepeatable(repeatableName, av);
AnnotationValue<?> annotationValue = new AnnotationValue(annotationName, annotationValues); VisitorContext visitorContext = createVisitorContext(); for (AnnotationMapper mapper : mappers) {