use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class ManagementContextConfigurationTests method proxyBeanMethodsCanBeDisabled.
@Test
void proxyBeanMethodsCanBeDisabled() {
AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(NoBeanMethodProxyingManagementContextConfiguration.class, Configuration.class);
assertThat(attributes.get("proxyBeanMethods")).isEqualTo(false);
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class ManagementContextConfigurationTests method proxyBeanMethodsIsEnabledByDefault.
@Test
void proxyBeanMethodsIsEnabledByDefault() {
AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(DefaultManagementContextConfiguration.class, Configuration.class);
assertThat(attributes.get("proxyBeanMethods")).isEqualTo(true);
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class OnEndpointElementCondition method getMatchOutcome.
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
AnnotationAttributes annotationAttributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(this.annotationType.getName()));
String endpointName = annotationAttributes.getString("value");
ConditionOutcome outcome = getEndpointOutcome(context, endpointName);
if (outcome != null) {
return outcome;
}
return getDefaultOutcome(context, annotationAttributes);
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class TestAutoConfigurationPackageRegistrar method registerBeanDefinitions.
@Override
public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
AnnotationAttributes attributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(TestAutoConfigurationPackage.class.getName(), true));
AutoConfigurationPackages.register(registry, ClassUtils.getPackageName(attributes.getString("value")));
}
use of org.springframework.core.annotation.AnnotationAttributes in project spring-boot by spring-projects.
the class OnPropertyCondition method getMatchOutcome.
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
List<AnnotationAttributes> allAnnotationAttributes = annotationAttributesFromMultiValueMap(metadata.getAllAnnotationAttributes(ConditionalOnProperty.class.getName()));
List<ConditionMessage> noMatch = new ArrayList<>();
List<ConditionMessage> match = new ArrayList<>();
for (AnnotationAttributes annotationAttributes : allAnnotationAttributes) {
ConditionOutcome outcome = determineOutcome(annotationAttributes, context.getEnvironment());
(outcome.isMatch() ? match : noMatch).add(outcome.getConditionMessage());
}
if (!noMatch.isEmpty()) {
return ConditionOutcome.noMatch(ConditionMessage.of(noMatch));
}
return ConditionOutcome.match(ConditionMessage.of(match));
}
Aggregations