Skip to content

Commit f2f58f1

Browse files
committed
Polish Javadoc in MimeType
1 parent 10a691b commit f2f58f1

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

spring-core/src/main/java/org/springframework/util/MimeType.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 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.
@@ -29,8 +29,10 @@
2929

3030
/**
3131
* Represents a MIME Type, as originally defined in RFC 2046 and subsequently used in
32-
* other Internet protocols including HTTP. This class however does not contain support
33-
* the q-parameters used in HTTP content negotiation. Those can be found in the sub-class
32+
* other Internet protocols including HTTP.
33+
*
34+
* <p>This class, however, does not contain support for the q-parameters used
35+
* in HTTP content negotiation. Those can be found in the sub-class
3436
* {@code org.springframework.http.MediaType} in the {@code spring-web} module.
3537
*
3638
* <p>Consists of a {@linkplain #getType() type} and a {@linkplain #getSubtype() subtype}.
@@ -40,6 +42,7 @@
4042
* @author Arjen Poutsma
4143
* @author Juergen Hoeller
4244
* @author Rossen Stoyanchev
45+
* @author Sam Brannen
4346
* @since 4.0
4447
* @see MimeTypeUtils
4548
*/
@@ -99,9 +102,10 @@ public class MimeType implements Comparable<MimeType>, Serializable {
99102

100103
/**
101104
* Create a new {@code MimeType} for the given primary type.
102-
* <p>The {@linkplain #getSubtype() subtype} is set to "&#42;", parameters empty.
105+
* <p>The {@linkplain #getSubtype() subtype} is set to <code>"&#42;"</code>,
106+
* and the parameters are empty.
103107
* @param type the primary type
104-
* @throws IllegalArgumentException if any of the parameters contain illegal characters
108+
* @throws IllegalArgumentException if any of the parameters contains illegal characters
105109
*/
106110
public MimeType(String type) {
107111
this(type, WILDCARD_TYPE);
@@ -112,7 +116,7 @@ public MimeType(String type) {
112116
* <p>The parameters are empty.
113117
* @param type the primary type
114118
* @param subtype the subtype
115-
* @throws IllegalArgumentException if any of the parameters contain illegal characters
119+
* @throws IllegalArgumentException if any of the parameters contains illegal characters
116120
*/
117121
public MimeType(String type, String subtype) {
118122
this(type, subtype, Collections.<String, String>emptyMap());
@@ -123,7 +127,7 @@ public MimeType(String type, String subtype) {
123127
* @param type the primary type
124128
* @param subtype the subtype
125129
* @param charSet the character set
126-
* @throws IllegalArgumentException if any of the parameters contain illegal characters
130+
* @throws IllegalArgumentException if any of the parameters contains illegal characters
127131
*/
128132
public MimeType(String type, String subtype, Charset charSet) {
129133
this(type, subtype, Collections.singletonMap(PARAM_CHARSET, charSet.name()));
@@ -134,7 +138,7 @@ public MimeType(String type, String subtype, Charset charSet) {
134138
* and allows for different parameter.
135139
* @param other the other media type
136140
* @param parameters the parameters, may be {@code null}
137-
* @throws IllegalArgumentException if any of the parameters contain illegal characters
141+
* @throws IllegalArgumentException if any of the parameters contains illegal characters
138142
*/
139143
public MimeType(MimeType other, Map<String, String> parameters) {
140144
this(other.getType(), other.getSubtype(), parameters);
@@ -145,7 +149,7 @@ public MimeType(MimeType other, Map<String, String> parameters) {
145149
* @param type the primary type
146150
* @param subtype the subtype
147151
* @param parameters the parameters, may be {@code null}
148-
* @throws IllegalArgumentException if any of the parameters contain illegal characters
152+
* @throws IllegalArgumentException if any of the parameters contains illegal characters
149153
*/
150154
public MimeType(String type, String subtype, Map<String, String> parameters) {
151155
Assert.hasLength(type, "type must not be empty");
@@ -215,25 +219,25 @@ protected String unquote(String s) {
215219

216220
/**
217221
* Indicates whether the {@linkplain #getType() type} is the wildcard character
218-
* {@code &#42;} or not.
222+
* <code>&#42;</code> or not.
219223
*/
220224
public boolean isWildcardType() {
221225
return WILDCARD_TYPE.equals(getType());
222226
}
223227

224228
/**
225-
* Indicates whether the {@linkplain #getSubtype() subtype} is the wildcard character
226-
* {@code &#42;} or the wildcard character followed by a sufiix (e.g.
227-
* {@code &#42;+xml}), or not.
228-
* @return whether the subtype is {@code &#42;}
229+
* Indicates whether the {@linkplain #getSubtype() subtype} is the wildcard
230+
* character <code>&#42;</code> or the wildcard character followed by a suffix
231+
* (e.g. <code>&#42;+xml</code>).
232+
* @return whether the subtype is a wildcard
229233
*/
230234
public boolean isWildcardSubtype() {
231235
return WILDCARD_TYPE.equals(getSubtype()) || getSubtype().startsWith("*+");
232236
}
233237

234238
/**
235-
* Indicates whether this media type is concrete, i.e. whether neither the type or
236-
* subtype is a wildcard character {@code &#42;}.
239+
* Indicates whether this media type is concrete, i.e. whether neither the type
240+
* nor the subtype is a wildcard character <code>&#42;</code>.
237241
* @return whether this media type is concrete
238242
*/
239243
public boolean isConcrete() {

0 commit comments

Comments
 (0)