类 Jackson2CodecSupport
- java.lang.Object
- org.springframework.http.codec.json.Jackson2CodecSupport
public abstract class Jackson2CodecSupport extends Object
Base class providing support methods for Jackson 2.9 encoding and decoding.- 从以下版本开始:
- 5.0
- 作者:
- Sebastien Deleuze, Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 static StringJSON_VIEW_HINTThe key for the hint to specify a "JSON View" for encoding or decoding with the value expected to be aClass.protected Loglogger
构造器概要
构造器 限定符 构造器 说明 protectedJackson2CodecSupport(ObjectMapper objectMapper, MimeType... mimeTypes)Constructor with a JacksonObjectMapperto use.
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract <A extends Annotation>
AgetAnnotation(MethodParameter parameter, Class<A> annotType)protected Map<String,Object>getHints(ResolvableType resolvableType)protected JavaTypegetJavaType(Type type, Class<?> contextClass)protected List<MimeType>getMimeTypes()Subclasses should expose this as "decodable" or "encodable" mime types.ObjectMappergetObjectMapper()protected MethodParametergetParameter(ResolvableType type)protected booleansupportsMimeType(MimeType mimeType)
字段详细资料
JSON_VIEW_HINT
public static final String JSON_VIEW_HINT
The key for the hint to specify a "JSON View" for encoding or decoding with the value expected to be aClass.- 另请参阅:
- Jackson JSON Views
构造器详细资料
Jackson2CodecSupport
protected Jackson2CodecSupport(ObjectMapper objectMapper, MimeType... mimeTypes)
Constructor with a JacksonObjectMapperto use.
方法详细资料
getObjectMapper
public ObjectMapper getObjectMapper()
getMimeTypes
protected List<MimeType> getMimeTypes()
Subclasses should expose this as "decodable" or "encodable" mime types.
supportsMimeType
protected boolean supportsMimeType(@Nullable MimeType mimeType)
getJavaType
protected JavaType getJavaType(Type type, @Nullable Class<?> contextClass)
getHints
protected Map<String,Object> getHints(ResolvableType resolvableType)
getParameter
@Nullable protected MethodParameter getParameter(ResolvableType type)
getAnnotation
@Nullable protected abstract <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType)