| 限定符和类型 | 类和说明 |
|---|---|
static class |
MimeType.SpecificityComparator<T extends MimeType> |
| 限定符和类型 | 字段和说明 |
|---|---|
protected static java.lang.String |
WILDCARD_TYPE |
| 构造器和说明 |
|---|
MimeType(MimeType other,
java.util.Map<java.lang.String,java.lang.String> parameters)
Copy-constructor that copies the type and subtype of the given
MimeType,
and allows for different parameter. |
MimeType(java.lang.String type)
Create a new
MimeType for the given primary type. |
MimeType(java.lang.String type,
java.lang.String subtype)
Create a new
MimeType for the given primary type and subtype. |
MimeType(java.lang.String type,
java.lang.String subtype,
java.nio.charset.Charset charSet)
Create a new
MimeType for the given type, subtype, and character set. |
MimeType(java.lang.String type,
java.lang.String subtype,
java.util.Map<java.lang.String,java.lang.String> parameters)
Create a new
MimeType for the given type, subtype, and parameters. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
appendTo(java.lang.StringBuilder builder) |
protected void |
checkParameters(java.lang.String attribute,
java.lang.String value) |
int |
compareTo(MimeType other)
Compares this
MediaType to another alphabetically. |
boolean |
equals(java.lang.Object other) |
java.nio.charset.Charset |
getCharSet()
Return the character set, as indicated by a
charset parameter, if any. |
java.lang.String |
getParameter(java.lang.String name)
Return a generic parameter value, given a parameter name.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Return all generic parameter values.
|
java.lang.String |
getSubtype()
Return the subtype.
|
java.lang.String |
getType()
Return the primary type.
|
int |
hashCode() |
boolean |
includes(MimeType other)
Indicate whether this
MediaType includes the given media type. |
boolean |
isCompatibleWith(MimeType other)
Indicate whether this
MediaType is compatible with the given media type. |
boolean |
isConcrete()
Indicates whether this media type is concrete, i.e. whether neither the type
nor the subtype is a wildcard character
*. |
boolean |
isJson() |
boolean |
isJsonp() |
boolean |
isWildcardSubtype()
Indicates whether the subtype is the wildcard
character
* or the wildcard character followed by a suffix
(e.g. |
boolean |
isWildcardType()
Indicates whether the type is the wildcard character
* or not. |
boolean |
isXml() |
java.lang.String |
toString() |
protected java.lang.String |
unquote(java.lang.String s) |
static MimeType |
valueOf(java.lang.String value)
Parse the given String value into a
MimeType object,
with this method name following the 'valueOf' naming convention
(as supported by org.frameworkset.core.convert.ConversionService. |
protected static final java.lang.String WILDCARD_TYPE
public MimeType(java.lang.String type)
MimeType for the given primary type.
The subtype is set to "*",
and the parameters are empty.
type - the primary typejava.lang.IllegalArgumentException - if any of the parameters contains illegal characterspublic MimeType(java.lang.String type,
java.lang.String subtype)
MimeType for the given primary type and subtype.
The parameters are empty.
type - the primary typesubtype - the subtypejava.lang.IllegalArgumentException - if any of the parameters contains illegal characterspublic MimeType(java.lang.String type,
java.lang.String subtype,
java.nio.charset.Charset charSet)
MimeType for the given type, subtype, and character set.type - the primary typesubtype - the subtypecharSet - the character setjava.lang.IllegalArgumentException - if any of the parameters contains illegal characterspublic MimeType(MimeType other, java.util.Map<java.lang.String,java.lang.String> parameters)
MimeType,
and allows for different parameter.other - the other media typeparameters - the parameters, may be nulljava.lang.IllegalArgumentException - if any of the parameters contains illegal characterspublic MimeType(java.lang.String type,
java.lang.String subtype,
java.util.Map<java.lang.String,java.lang.String> parameters)
MimeType for the given type, subtype, and parameters.type - the primary typesubtype - the subtypeparameters - the parameters, may be nulljava.lang.IllegalArgumentException - if any of the parameters contains illegal characterspublic boolean isJsonp()
public boolean isJson()
public boolean isXml()
protected void checkParameters(java.lang.String attribute,
java.lang.String value)
protected java.lang.String unquote(java.lang.String s)
public boolean isWildcardType()
* or not.public boolean isWildcardSubtype()
* or the wildcard character followed by a suffix
(e.g. *+xml).public boolean isConcrete()
*.public java.lang.String getType()
public java.lang.String getSubtype()
public java.nio.charset.Charset getCharSet()
charset parameter, if any.null if not availablepublic java.lang.String getParameter(java.lang.String name)
name - the parameter namenull if not presentpublic java.util.Map<java.lang.String,java.lang.String> getParameters()
null)public boolean includes(MimeType other)
MediaType includes the given media type.
For instance, text/* includes text/plain and text/html,
and application/*+xml includes application/soap+xml, etc. This
method is not symmetric.
other - the reference media type with which to comparetrue if this media type includes the given media type;
false otherwisepublic boolean isCompatibleWith(MimeType other)
MediaType is compatible with the given media type.
For instance, text/* is compatible with text/plain,
text/html, and vice versa. In effect, this method is similar to
includes(org.frameworkset.http.MimeType), except that it is symmetric.
other - the reference media type with which to comparetrue if this media type is compatible with the given media type;
false otherwisepublic int compareTo(MimeType other)
MediaType to another alphabetically.compareTo 在接口中 java.lang.Comparable<MimeType>other - media type to compare toMimeTypeUtils.sortBySpecificity(List)public boolean equals(java.lang.Object other)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Objectprotected void appendTo(java.lang.StringBuilder builder)
public static MimeType valueOf(java.lang.String value)
MimeType object,
with this method name following the 'valueOf' naming convention
(as supported by org.frameworkset.core.convert.ConversionService.