List of usage examples for org.springframework.core.codec Hints none
public static Map<String, Object> none()
From source file:org.springframework.http.codec.DecoderHttpMessageReader.java
/** * Get additional hints for decoding for example based on the server request * or annotations from controller method parameters. By default, delegate to * the decoder if it is an instance of {@link HttpMessageDecoder}. */// ww w . j a va 2s . com protected Map<String, Object> getReadHints(ResolvableType actualType, ResolvableType elementType, ServerHttpRequest request, ServerHttpResponse response) { if (this.decoder instanceof HttpMessageDecoder) { HttpMessageDecoder<?> decoder = (HttpMessageDecoder<?>) this.decoder; return decoder.getDecodeHints(actualType, elementType, request, response); } return Hints.none(); }
From source file:org.springframework.http.codec.EncoderHttpMessageWriter.java
/** * Get additional hints for encoding for example based on the server request * or annotations from controller method parameters. By default, delegate to * the encoder if it is an instance of {@link HttpMessageEncoder}. *//* w ww . j ava2 s. c om*/ protected Map<String, Object> getWriteHints(ResolvableType streamType, ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response) { if (this.encoder instanceof HttpMessageEncoder) { HttpMessageEncoder<?> encoder = (HttpMessageEncoder<?>) this.encoder; return encoder.getEncodeHints(streamType, elementType, mediaType, request, response); } return Hints.none(); }
From source file:org.springframework.http.codec.json.Jackson2CodecSupport.java
protected Map<String, Object> getHints(ResolvableType resolvableType) { MethodParameter param = getParameter(resolvableType); if (param != null) { JsonView annotation = getAnnotation(param, JsonView.class); if (annotation != null) { Class<?>[] classes = annotation.value(); Assert.isTrue(classes.length == 1, JSON_VIEW_HINT_ERROR + param); return Hints.from(JSON_VIEW_HINT, classes[0]); }/*w w w . ja v a 2 s . co m*/ } return Hints.none(); }