Polishing

This commit is contained in:
Juergen Hoeller
2016-07-06 15:29:15 +02:00
parent 19e5a34f9f
commit 102dc8a4dd
10 changed files with 110 additions and 106 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 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.
@@ -51,8 +51,8 @@ import javax.servlet.http.HttpServletResponse;
public interface LocaleResolver {
/**
* Resolve the current locale via the given request. Can return a default locale as
* fallback in any case.
* Resolve the current locale via the given request.
* Can return a default locale as fallback in any case.
* @param request the request to resolve the locale for
* @return the current locale (never {@code null})
*/
@@ -63,8 +63,8 @@ public interface LocaleResolver {
* @param request the request to be used for locale modification
* @param response the response to be used for locale modification
* @param locale the new locale, or {@code null} to clear the locale
* @throws UnsupportedOperationException if the LocaleResolver implementation does not
* support dynamic changing of the locale
* @throws UnsupportedOperationException if the LocaleResolver
* implementation does not support dynamic changing of the locale
*/
void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 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.
@@ -23,7 +23,7 @@ import org.springframework.web.servlet.AsyncHandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
/**
* Abstract adapter class for the HandlerInterceptor interface,
* Abstract adapter class for the {@link AsyncHandlerInterceptor} interface,
* for simplified implementation of pre-only/post-only interceptors.
*
* @author Juergen Hoeller
@@ -36,7 +36,8 @@ public abstract class HandlerInterceptorAdapter implements AsyncHandlerIntercept
*/
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
throws Exception {
return true;
}

View File

@@ -123,8 +123,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
private boolean hasScheme(String link) {
int schemeIndex = link.indexOf(":");
return (schemeIndex > 0 && !link.substring(0, schemeIndex).contains("/"))
|| link.indexOf("//") == 0;
return (schemeIndex > 0 && !link.substring(0, schemeIndex).contains("/")) || link.indexOf("//") == 0;
}
@@ -132,9 +131,9 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
protected interface CssLinkParser {
void parseLink(String content, Set<CssLinkInfo> linkInfos);
}
protected static abstract class AbstractCssLinkParser implements CssLinkParser {
/**
@@ -190,6 +189,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
}
private static class ImportStatementCssLinkParser extends AbstractCssLinkParser {
@Override
@@ -209,6 +209,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
}
}
private static class UrlFunctionCssLinkParser extends AbstractCssLinkParser {
@Override
@@ -230,8 +231,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
private final int end;
private CssLinkInfo(int start, int end) {
public CssLinkInfo(int start, int end) {
this.start = start;
this.end = end;
}

View File

@@ -36,10 +36,10 @@ public interface ResourceTransformer {
* @param request the current request
* @param resource the resource to transform
* @param transformerChain the chain of remaining transformers to delegate to
* @return the transformed resource, never {@code null}
* @return the transformed resource (never {@code null})
* @throws IOException if the transformation fails
*/
Resource transform(HttpServletRequest request, Resource resource, ResourceTransformerChain transformerChain)
throws IOException;
}
}