Java Code Examples for org.springframework.core.codec.Hints#merge()

The following examples show how to use org.springframework.core.codec.Hints#merge() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultipartHttpMessageReader.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Override
public Mono<MultiValueMap<String, Part>> readMono(ResolvableType elementType,
		ReactiveHttpInputMessage inputMessage, Map<String, Object> hints) {


	Map<String, Object> allHints = Hints.merge(hints, Hints.SUPPRESS_LOGGING_HINT, true);

	return this.partReader.read(elementType, inputMessage, allHints)
			.collectMultimap(Part::name)
			.doOnNext(map ->
				LogFormatUtils.traceDebug(logger, traceOn -> Hints.getLogPrefix(hints) + "Parsed " +
						(isEnableLoggingRequestDetails() ?
								LogFormatUtils.formatValue(map, !traceOn) :
								"parts " + map.keySet() + " (content masked)"))
			)
			.map(this::toMultiValueMap);
}
 
Example 2
Source File: MultipartHttpMessageReader.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Override
public Mono<MultiValueMap<String, Part>> readMono(ResolvableType elementType,
		ReactiveHttpInputMessage inputMessage, Map<String, Object> hints) {


	Map<String, Object> allHints = Hints.merge(hints, Hints.SUPPRESS_LOGGING_HINT, true);

	return this.partReader.read(elementType, inputMessage, allHints)
			.collectMultimap(Part::name)
			.doOnNext(map -> {
				LogFormatUtils.traceDebug(logger, traceOn -> Hints.getLogPrefix(hints) + "Parsed " +
						(isEnableLoggingRequestDetails() ?
								LogFormatUtils.formatValue(map, !traceOn) :
								"parts " + map.keySet() + " (content masked)"));
			})
			.map(this::toMultiValueMap);
}
 
Example 3
Source File: DecoderHttpMessageReader.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public Flux<T> read(ResolvableType actualType, ResolvableType elementType,
		ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getReadHints(actualType, elementType, request, response));

	return read(elementType, request, allHints);
}
 
Example 4
Source File: DecoderHttpMessageReader.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public Mono<T> readMono(ResolvableType actualType, ResolvableType elementType,
		ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getReadHints(actualType, elementType, request, response));

	return readMono(elementType, request, allHints);
}
 
Example 5
Source File: EncoderHttpMessageWriter.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public Mono<Void> write(Publisher<? extends T> inputStream, ResolvableType actualType,
		ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request,
		ServerHttpResponse response, Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getWriteHints(actualType, elementType, mediaType, request, response));

	return write(inputStream, elementType, mediaType, response, allHints);
}
 
Example 6
Source File: ServerSentEventHttpMessageWriter.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
public Mono<Void> write(Publisher<?> input, ResolvableType actualType, ResolvableType elementType,
		@Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response,
		Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getEncodeHints(actualType, elementType, mediaType, request, response));

	return write(input, elementType, mediaType, response, allHints);
}
 
Example 7
Source File: DecoderHttpMessageReader.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public Flux<T> read(ResolvableType actualType, ResolvableType elementType,
		ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getReadHints(actualType, elementType, request, response));

	return read(elementType, request, allHints);
}
 
Example 8
Source File: DecoderHttpMessageReader.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public Mono<T> readMono(ResolvableType actualType, ResolvableType elementType,
		ServerHttpRequest request, ServerHttpResponse response, Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getReadHints(actualType, elementType, request, response));

	return readMono(elementType, request, allHints);
}
 
Example 9
Source File: EncoderHttpMessageWriter.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public Mono<Void> write(Publisher<? extends T> inputStream, ResolvableType actualType,
		ResolvableType elementType, @Nullable MediaType mediaType, ServerHttpRequest request,
		ServerHttpResponse response, Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getWriteHints(actualType, elementType, mediaType, request, response));

	return write(inputStream, elementType, mediaType, response, allHints);
}
 
Example 10
Source File: ServerSentEventHttpMessageWriter.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public Mono<Void> write(Publisher<?> input, ResolvableType actualType, ResolvableType elementType,
		@Nullable MediaType mediaType, ServerHttpRequest request, ServerHttpResponse response,
		Map<String, Object> hints) {

	Map<String, Object> allHints = Hints.merge(hints,
			getEncodeHints(actualType, elementType, mediaType, request, response));

	return write(input, elementType, mediaType, response, allHints);
}
 
Example 11
Source File: DefaultServerRequest.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public <T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor, Map<String, Object> hints) {
	hints = Hints.merge(hints, Hints.LOG_PREFIX_HINT, exchange().getLogPrefix());
	return bodyInternal(extractor, hints);
}
 
Example 12
Source File: DefaultServerRequest.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public <T> T body(BodyExtractor<T, ? super ServerHttpRequest> extractor, Map<String, Object> hints) {
	hints = Hints.merge(hints, Hints.LOG_PREFIX_HINT, exchange().getLogPrefix());
	return bodyInternal(extractor, hints);
}