Merge branch '2.0.x'

This commit is contained in:
Phillip Webb
2018-09-04 16:25:17 -07:00
18 changed files with 36 additions and 35 deletions

View File

@@ -30,7 +30,6 @@ import org.springframework.core.env.Environment;
* default the properties must be present in the {@link Environment} and
* <strong>not</strong> equal to {@code false}. The {@link #havingValue()} and
* {@link #matchIfMissing()} attributes allow further customizations.
*
* <p>
* The {@link #havingValue} attribute can be used to specify the value that the property
* should have. The table below shows when a condition matches according to the property
@@ -67,12 +66,10 @@ import org.springframework.core.env.Environment;
* <td>yes</td>
* </tr>
* </table>
*
* <p>
* If the property is not contained in the {@link Environment} at all, the
* {@link #matchIfMissing()} attribute is consulted. By default missing attributes do not
* match.
*
* <p>
* This condition cannot be reliably used for matching collection properties. For example,
* in the following configuration, the condition matches if {@code spring.example.values}

View File

@@ -36,7 +36,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
*/
public class OnPropertyListCondition extends SpringBootCondition {
private static final Bindable<List<String>> SIMPLE_LIST = Bindable
private static final Bindable<List<String>> STRING_LIST = Bindable
.listOf(String.class);
private final String propertyName;
@@ -59,7 +59,7 @@ public class OnPropertyListCondition extends SpringBootCondition {
public ConditionOutcome getMatchOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
BindResult<?> property = Binder.get(context.getEnvironment())
.bind(this.propertyName, SIMPLE_LIST);
.bind(this.propertyName, STRING_LIST);
ConditionMessage.Builder messageBuilder = this.messageBuilder.get();
if (property.isBound()) {
return ConditionOutcome

View File

@@ -65,10 +65,8 @@ class OnWebApplicationCondition extends SpringBootCondition {
switch (deduceType(metadata)) {
case SERVLET:
return isServletWebApplication(context);
case REACTIVE:
return isReactiveWebApplication(context);
default:
return isAnyWebApplication(context, required);
}

View File

@@ -24,6 +24,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
* used for Spring MVC applications.
*
* @author Madhura Bhave
* @since 2.0.5
*/
public class MvcRequestMatcherProvider implements RequestMatcherProvider {

View File

@@ -27,6 +27,11 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
@FunctionalInterface
public interface RequestMatcherProvider {
/**
* Return the {@link RequestMatcher} to be used for the specified pattern.
* @param pattern the request pattern
* @return a request matcher
*/
RequestMatcher getRequestMatcher(String pattern);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.