类 UnsupportedMediaTypeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cn.taketoday.core.NestedRuntimeException
cn.taketoday.web.reactive.function.UnsupportedMediaTypeException
- 所有已实现的接口:
Serializable
public class UnsupportedMediaTypeException
extends cn.taketoday.core.NestedRuntimeException
Exception thrown to indicate that a
Content-Type is not supported.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明UnsupportedMediaTypeException(MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeException(MediaType contentType, List<MediaType> supportedTypes, cn.taketoday.core.ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeException(String reason) Constructor for when the specified Content-Type is invalid. -
方法概要
修饰符和类型方法说明cn.taketoday.core.ResolvableTypeReturn the body type in the context of which this exception was generated.Return the request Content-Type header if it was parsed successfully, ornullotherwise.Return the list of supported content types in cases when the Content-Type header is parsed but not supported, or an empty list otherwise.private static StringinitReason(MediaType contentType, cn.taketoday.core.ResolvableType bodyType) 从类继承的方法 cn.taketoday.core.NestedRuntimeException
contains, getMostSpecificCause, getNestedMessage, getRootCause
-
字段详细资料
-
contentType
-
supportedMediaTypes
-
bodyType
@Nullable private final cn.taketoday.core.ResolvableType bodyType
-
-
构造器详细资料
-
UnsupportedMediaTypeException
Constructor for when the specified Content-Type is invalid. -
UnsupportedMediaTypeException
public UnsupportedMediaTypeException(@Nullable MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported. -
UnsupportedMediaTypeException
public UnsupportedMediaTypeException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable cn.taketoday.core.ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.
-
-
方法详细资料
-
initReason
-
getContentType
Return the request Content-Type header if it was parsed successfully, ornullotherwise. -
getSupportedMediaTypes
Return the list of supported content types in cases when the Content-Type header is parsed but not supported, or an empty list otherwise. -
getBodyType
@Nullable public cn.taketoday.core.ResolvableType getBodyType()Return the body type in the context of which this exception was generated. This is applicable when the exception was raised as a result trying to encode from or decode to a specific Java type.- 返回:
- the body type, or
nullif not available
-