Polishing
This commit is contained in:
@@ -189,7 +189,7 @@ abstract class MvcNamespaceUtils {
|
||||
/**
|
||||
* Find the {@code ContentNegotiationManager} bean created by or registered
|
||||
* with the {@code annotation-driven} element.
|
||||
* @return a bean definition, bean reference, or null.
|
||||
* @return a bean definition, bean reference, or {@code null}
|
||||
*/
|
||||
@Nullable
|
||||
public static Object getContentNegotiationManager(ParserContext context) {
|
||||
|
||||
@@ -37,9 +37,9 @@ import org.springframework.web.servlet.view.RedirectView;
|
||||
* {@link org.springframework.beans.factory.xml.BeanDefinitionParser} that
|
||||
* parses the following MVC namespace elements:
|
||||
* <ul>
|
||||
* <li>{@code <view-controller>}
|
||||
* <li>{@code <redirect-view-controller>}
|
||||
* <li>{@code <status-controller>}
|
||||
* <li>{@code <view-controller>}
|
||||
* <li>{@code <redirect-view-controller>}
|
||||
* <li>{@code <status-controller>}
|
||||
* </ul>
|
||||
*
|
||||
* <p>All elements result in the registration of a
|
||||
@@ -56,7 +56,7 @@ import org.springframework.web.servlet.view.RedirectView;
|
||||
class ViewControllerBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
private static final String HANDLER_MAPPING_BEAN_NAME =
|
||||
"org.springframework.web.servlet.config.viewControllerHandlerMapping";
|
||||
"org.springframework.web.servlet.config.viewControllerHandlerMapping";
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
|
||||
@@ -42,11 +42,11 @@ public class InterceptorRegistration {
|
||||
|
||||
private final List<String> excludePatterns = new ArrayList<>();
|
||||
|
||||
private int order = 0;
|
||||
|
||||
@Nullable
|
||||
private PathMatcher pathMatcher;
|
||||
|
||||
private int order = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Creates an {@link InterceptorRegistration} instance.
|
||||
@@ -72,18 +72,6 @@ public class InterceptorRegistration {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An order position to be used, default is 0.
|
||||
*/
|
||||
public InterceptorRegistration order(int order){
|
||||
this.order = order;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
/**
|
||||
* A PathMatcher implementation to use with this interceptor. This is an optional,
|
||||
* advanced property required only if using custom PathMatcher implementations
|
||||
@@ -95,6 +83,23 @@ public class InterceptorRegistration {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify an order position to be used. Default is 0.
|
||||
* @since 5.0
|
||||
*/
|
||||
public InterceptorRegistration order(int order){
|
||||
this.order = order;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the order position to be used.
|
||||
* @since 5.0
|
||||
*/
|
||||
protected int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the underlying interceptor. If URL patterns are provided the returned type is
|
||||
* {@link MappedInterceptor}; otherwise {@link HandlerInterceptor}.
|
||||
|
||||
@@ -134,4 +134,5 @@ abstract class AbstractNameValueExpression<T> implements NameValueExpression<T>
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -144,8 +144,8 @@ public final class ParamsRequestCondition extends AbstractRequestCondition<Param
|
||||
|
||||
@Override
|
||||
protected boolean matchName(HttpServletRequest request) {
|
||||
return WebUtils.hasSubmitParameter(request, this.name) ||
|
||||
request.getParameterMap().containsKey(this.name);
|
||||
return (WebUtils.hasSubmitParameter(request, this.name) ||
|
||||
request.getParameterMap().containsKey(this.name));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -113,55 +113,55 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL patterns of this {@link RequestMappingInfo};
|
||||
* or instance with 0 patterns, never {@code null}.
|
||||
* Return the URL patterns of this {@link RequestMappingInfo};
|
||||
* or instance with 0 patterns (never {@code null}).
|
||||
*/
|
||||
public PatternsRequestCondition getPatternsCondition() {
|
||||
return this.patternsCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the HTTP request methods of this {@link RequestMappingInfo};
|
||||
* or instance with 0 request methods, never {@code null}.
|
||||
* Return the HTTP request methods of this {@link RequestMappingInfo};
|
||||
* or instance with 0 request methods (never {@code null}).
|
||||
*/
|
||||
public RequestMethodsRequestCondition getMethodsCondition() {
|
||||
return this.methodsCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "parameters" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 parameter expressions, never {@code null}.
|
||||
* Return the "parameters" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 parameter expressions (never {@code null}).
|
||||
*/
|
||||
public ParamsRequestCondition getParamsCondition() {
|
||||
return this.paramsCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "headers" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 header expressions, never {@code null}.
|
||||
* Return the "headers" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 header expressions (never {@code null}).
|
||||
*/
|
||||
public HeadersRequestCondition getHeadersCondition() {
|
||||
return this.headersCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "consumes" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 consumes expressions, never {@code null}.
|
||||
* Return the "consumes" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 consumes expressions (never {@code null}).
|
||||
*/
|
||||
public ConsumesRequestCondition getConsumesCondition() {
|
||||
return this.consumesCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "produces" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 produces expressions, never {@code null}.
|
||||
* Return the "produces" condition of this {@link RequestMappingInfo};
|
||||
* or instance with 0 produces expressions (never {@code null}).
|
||||
*/
|
||||
public ProducesRequestCondition getProducesCondition() {
|
||||
return this.producesCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "custom" condition of this {@link RequestMappingInfo}; or {@code null}.
|
||||
* Return the "custom" condition of this {@link RequestMappingInfo}, or {@code null}.
|
||||
*/
|
||||
@Nullable
|
||||
public RequestCondition<?> getCustomCondition() {
|
||||
@@ -170,7 +170,7 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping
|
||||
|
||||
|
||||
/**
|
||||
* Combines "this" request mapping info (i.e. the current instance) with another request mapping info instance.
|
||||
* Combine "this" request mapping info (i.e. the current instance) with another request mapping info instance.
|
||||
* <p>Example: combine type- and method-level request mappings.
|
||||
* @return a new request mapping info instance; never {@code null}
|
||||
*/
|
||||
@@ -199,7 +199,7 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping
|
||||
return this.name;
|
||||
}
|
||||
else {
|
||||
return (other.name != null ? other.name : null);
|
||||
return other.name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class HttpHeadersReturnValueHandler implements HandlerMethodReturnValueHa
|
||||
Assert.state(servletResponse != null, "No HttpServletResponse");
|
||||
ServletServerHttpResponse outputMessage = new ServletServerHttpResponse(servletResponse);
|
||||
outputMessage.getHeaders().putAll(headers);
|
||||
outputMessage.getBody(); // flush headers
|
||||
outputMessage.getBody(); // flush headers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
|
||||
*/
|
||||
@Nullable
|
||||
public List<HandlerMethodArgumentResolver> getInitBinderArgumentResolvers() {
|
||||
return (this.initBinderArgumentResolvers != null) ? this.initBinderArgumentResolvers.getResolvers() : null;
|
||||
return (this.initBinderArgumentResolvers != null ? this.initBinderArgumentResolvers.getResolvers() : null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -427,6 +427,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
|
||||
/**
|
||||
* Configure the registry for reactive library types to be supported as
|
||||
* return values from controller methods.
|
||||
* @since 5.0
|
||||
*/
|
||||
public void setReactiveRegistry(ReactiveAdapterRegistry reactiveRegistry) {
|
||||
Assert.notNull(reactiveRegistry, "ReactiveAdapterRegistry is required");
|
||||
@@ -435,6 +436,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
|
||||
|
||||
/**
|
||||
* Return the configured reactive type registry of adapters.
|
||||
* @since 5.0
|
||||
*/
|
||||
public ReactiveAdapterRegistry getReactiveAdapterRegistry() {
|
||||
return this.reactiveRegistry;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Param {
|
||||
|
||||
|
||||
/**
|
||||
* Set the raw name of the parameter
|
||||
* Set the raw name of the parameter.
|
||||
*/
|
||||
public void setName(@Nullable String name) {
|
||||
this.name = name;
|
||||
@@ -54,14 +54,14 @@ public class Param {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the raw value of the parameter
|
||||
* Set the raw value of the parameter.
|
||||
*/
|
||||
public void setValue(@Nullable String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the raw parameter value
|
||||
* Return the raw parameter value.
|
||||
*/
|
||||
@Nullable
|
||||
public String getValue() {
|
||||
|
||||
@@ -203,7 +203,6 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
|
||||
/**
|
||||
* Build the URL for the tag from the tag attributes and parameters.
|
||||
* @return the URL value as a String
|
||||
* @throws JspException
|
||||
*/
|
||||
String createUrl() throws JspException {
|
||||
Assert.state(this.value != null, "No value set");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2017 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.
|
||||
@@ -33,7 +33,7 @@ import freemarker.template.Configuration;
|
||||
public interface FreeMarkerConfig {
|
||||
|
||||
/**
|
||||
* Return the FreeMarker Configuration object for the current
|
||||
* Return the FreeMarker {@link Configuration} object for the current
|
||||
* web application context.
|
||||
* <p>A FreeMarker Configuration object may be used to set FreeMarker
|
||||
* properties and shared objects, and allows to retrieve templates.
|
||||
|
||||
Reference in New Issue
Block a user