Polishing

This commit is contained in:
Juergen Hoeller
2018-02-02 11:34:03 +01:00
parent 4a1cc9ced7
commit 7f96827ade
5 changed files with 51 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-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.
@@ -41,6 +41,7 @@ import org.springframework.web.util.HtmlUtils;
* tags and macros, the same status class is used for both scenarios.
*
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @since 5.0
* @see RequestContext#getBindStatus
*/
@@ -58,9 +59,13 @@ public class BindStatus {
@Nullable
private final Errors errors;
private final String[] errorCodes;
@Nullable
private BindingResult bindingResult;
private String[] errorMessages;
@Nullable
private List<? extends ObjectError> objectErrors;
@Nullable
private Object value;
@@ -75,12 +80,7 @@ public class BindStatus {
private PropertyEditor editor;
@Nullable
private List<? extends ObjectError> objectErrors;
private String[] errorCodes = new String[0];
@Nullable
private String[] errorMessages;
private BindingResult bindingResult;
/**
@@ -91,9 +91,7 @@ public class BindStatus {
* @param htmlEscape whether to HTML-escape error messages and string values
* @throws IllegalStateException if no corresponding Errors object found
*/
public BindStatus(RequestContext requestContext, String path, boolean htmlEscape)
throws IllegalStateException {
public BindStatus(RequestContext requestContext, String path, boolean htmlEscape) throws IllegalStateException {
this.requestContext = requestContext;
this.path = path;
this.htmlEscape = htmlEscape;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-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.
@@ -16,6 +16,7 @@
package org.springframework.web.reactive.result.view;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -46,7 +47,9 @@ public interface View {
/**
* Return the list of media types this View supports, or an empty list.
*/
List<MediaType> getSupportedMediaTypes();
default List<MediaType> getSupportedMediaTypes() {
return Collections.emptyList();
}
/**
* Whether this View does rendering by performing a redirect.