Skip to content

Commit c777468

Browse files
committed
Polishing
1 parent 721fd20 commit c777468

File tree

3 files changed

+63
-61
lines changed

3 files changed

+63
-61
lines changed

spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,12 +61,12 @@ public class AopNamespaceHandler extends NamespaceHandlerSupport {
6161
*/
6262
@Override
6363
public void init() {
64-
// In 2.0 XSD as well as in 2.1 XSD.
64+
// In 2.0 XSD as well as in 2.5+ XSDs
6565
registerBeanDefinitionParser("config", new ConfigBeanDefinitionParser());
6666
registerBeanDefinitionParser("aspectj-autoproxy", new AspectJAutoProxyBeanDefinitionParser());
6767
registerBeanDefinitionDecorator("scoped-proxy", new ScopedProxyBeanDefinitionDecorator());
6868

69-
// Only in 2.0 XSD: moved to context namespace as of 2.1
69+
// Only in 2.0 XSD: moved to context namespace in 2.5+
7070
registerBeanDefinitionParser("spring-configured", new SpringConfiguredBeanDefinitionParser());
7171
}
7272

spring-web/src/main/java/org/springframework/web/util/DefaultUriBuilderFactory.java

+56-56
Original file line numberDiff line numberDiff line change
@@ -40,62 +40,6 @@
4040
*/
4141
public class DefaultUriBuilderFactory implements UriBuilderFactory {
4242

43-
/**
44-
* Enum to represent multiple URI encoding strategies. The following are
45-
* available:
46-
* <ul>
47-
* <li>{@link #TEMPLATE_AND_VALUES}
48-
* <li>{@link #VALUES_ONLY}
49-
* <li>{@link #URI_COMPONENT}
50-
* <li>{@link #NONE}
51-
* </ul>
52-
* @see #setEncodingMode
53-
*/
54-
public enum EncodingMode {
55-
56-
/**
57-
* Pre-encode the URI template first, then strictly encode URI variables
58-
* when expanded, with the following rules:
59-
* <ul>
60-
* <li>For the URI template replace <em>only</em> non-ASCII and illegal
61-
* (within a given URI component type) characters with escaped octets.
62-
* <li>For URI variables do the same and also replace characters with
63-
* reserved meaning.
64-
* </ul>
65-
* <p>For most cases, this mode is most likely to give the expected
66-
* result because in treats URI variables as opaque data to be fully
67-
* encoded, while {@link #URI_COMPONENT} by comparison is useful only
68-
* if intentionally expanding URI variables with reserved characters.
69-
* @since 5.0.8
70-
* @see UriComponentsBuilder#encode()
71-
*/
72-
TEMPLATE_AND_VALUES,
73-
74-
/**
75-
* Does not encode the URI template and instead applies strict encoding
76-
* to URI variables via {@link UriUtils#encodeUriVariables} prior to
77-
* expanding them into the template.
78-
* @see UriUtils#encodeUriVariables(Object...)
79-
* @see UriUtils#encodeUriVariables(Map)
80-
*/
81-
VALUES_ONLY,
82-
83-
/**
84-
* Expand URI variables first, and then encode the resulting URI
85-
* component values, replacing <em>only</em> non-ASCII and illegal
86-
* (within a given URI component type) characters, but not characters
87-
* with reserved meaning.
88-
* @see UriComponents#encode()
89-
*/
90-
URI_COMPONENT,
91-
92-
/**
93-
* No encoding should be applied.
94-
*/
95-
NONE
96-
}
97-
98-
9943
@Nullable
10044
private final UriComponentsBuilder baseUri;
10145

@@ -222,6 +166,62 @@ public UriBuilder builder() {
222166
}
223167

224168

169+
/**
170+
* Enum to represent multiple URI encoding strategies. The following are
171+
* available:
172+
* <ul>
173+
* <li>{@link #TEMPLATE_AND_VALUES}
174+
* <li>{@link #VALUES_ONLY}
175+
* <li>{@link #URI_COMPONENT}
176+
* <li>{@link #NONE}
177+
* </ul>
178+
* @see #setEncodingMode
179+
*/
180+
public enum EncodingMode {
181+
182+
/**
183+
* Pre-encode the URI template first, then strictly encode URI variables
184+
* when expanded, with the following rules:
185+
* <ul>
186+
* <li>For the URI template replace <em>only</em> non-ASCII and illegal
187+
* (within a given URI component type) characters with escaped octets.
188+
* <li>For URI variables do the same and also replace characters with
189+
* reserved meaning.
190+
* </ul>
191+
* <p>For most cases, this mode is most likely to give the expected
192+
* result because in treats URI variables as opaque data to be fully
193+
* encoded, while {@link #URI_COMPONENT} by comparison is useful only
194+
* if intentionally expanding URI variables with reserved characters.
195+
* @since 5.0.8
196+
* @see UriComponentsBuilder#encode()
197+
*/
198+
TEMPLATE_AND_VALUES,
199+
200+
/**
201+
* Does not encode the URI template and instead applies strict encoding
202+
* to URI variables via {@link UriUtils#encodeUriVariables} prior to
203+
* expanding them into the template.
204+
* @see UriUtils#encodeUriVariables(Object...)
205+
* @see UriUtils#encodeUriVariables(Map)
206+
*/
207+
VALUES_ONLY,
208+
209+
/**
210+
* Expand URI variables first, and then encode the resulting URI
211+
* component values, replacing <em>only</em> non-ASCII and illegal
212+
* (within a given URI component type) characters, but not characters
213+
* with reserved meaning.
214+
* @see UriComponents#encode()
215+
*/
216+
URI_COMPONENT,
217+
218+
/**
219+
* No encoding should be applied.
220+
*/
221+
NONE
222+
}
223+
224+
225225
/**
226226
* {@link DefaultUriBuilderFactory} specific implementation of UriBuilder.
227227
*/

spring-web/src/main/java/org/springframework/web/util/UriBuilderFactory.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.web.util;
1718

1819
/**
@@ -22,13 +23,14 @@
2223
*
2324
* @author Rossen Stoyanchev
2425
* @since 5.0
26+
* @see DefaultUriBuilderFactory
2527
*/
2628
public interface UriBuilderFactory extends UriTemplateHandler {
2729

2830
/**
2931
* Initialize a builder with the given URI template.
3032
* @param uriTemplate the URI template to use
31-
* @return the URI builder instance
33+
* @return the builder instance
3234
*/
3335
UriBuilder uriString(String uriTemplate);
3436

0 commit comments

Comments
 (0)