org.springframework.core.codec.CharSequenceEncoder源码实例Demo

类org.springframework.core.codec.CharSequenceEncoder源码实例Demo

下面列出了org.springframework.core.codec.CharSequenceEncoder 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。


private MessageMappingMessageHandler initMesssageHandler() {

		List<Decoder<?>> decoders = Collections.singletonList(StringDecoder.allMimeTypes());
		List<Encoder<?>> encoders = Collections.singletonList(CharSequenceEncoder.allMimeTypes());

		ReactiveAdapterRegistry registry = ReactiveAdapterRegistry.getSharedInstance();
		this.returnValueHandler = new TestEncoderMethodReturnValueHandler(encoders, registry);

		PropertySource<?> source = new MapPropertySource("test", Collections.singletonMap("path", "path123"));

		StaticApplicationContext context = new StaticApplicationContext();
		context.getEnvironment().getPropertySources().addFirst(source);
		context.registerSingleton("testController", TestController.class);
		context.refresh();

		MessageMappingMessageHandler messageHandler = new MessageMappingMessageHandler();
		messageHandler.getReturnValueHandlerConfigurer().addCustomHandler(this.returnValueHandler);
		messageHandler.setApplicationContext(context);
		messageHandler.setEmbeddedValueResolver(new EmbeddedValueResolver(context.getBeanFactory()));
		messageHandler.setDecoders(decoders);
		messageHandler.afterPropertiesSet();

		return messageHandler;
	}
 

@Test
public void bodyClass() {
	String body = "foo";
	Publisher<String> publisher = Mono.just(body);
	ClientRequest result = ClientRequest.create(POST, URI.create("https://example.com"))
			.body(publisher, String.class).build();

	List<HttpMessageWriter<?>> messageWriters = new ArrayList<>();
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));

	ExchangeStrategies strategies = mock(ExchangeStrategies.class);
	given(strategies.messageWriters()).willReturn(messageWriters);

	MockClientHttpRequest request = new MockClientHttpRequest(GET, "/");
	result.writeTo(request, strategies).block();
	assertNotNull(request.getBody());

	StepVerifier.create(request.getBody())
			.expectNextCount(1)
			.verifyComplete();
}
 

@Test
public void bodyParameterizedTypeReference() {
	String body = "foo";
	Publisher<String> publisher = Mono.just(body);
	ParameterizedTypeReference<String> typeReference = new ParameterizedTypeReference<String>() {};
	ClientRequest result = ClientRequest.create(POST, URI.create("https://example.com"))
			.body(publisher, typeReference).build();

	List<HttpMessageWriter<?>> messageWriters = new ArrayList<>();
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));

	ExchangeStrategies strategies = mock(ExchangeStrategies.class);
	given(strategies.messageWriters()).willReturn(messageWriters);

	MockClientHttpRequest request = new MockClientHttpRequest(GET, "/");
	result.writeTo(request, strategies).block();
	assertNotNull(request.getBody());

	StepVerifier.create(request.getBody())
			.expectNextCount(1)
			.verifyComplete();
}
 

@Test
public void multipleMatchesNotSupported() throws Exception {
	this.view = new HttpMessageWriterView(CharSequenceEncoder.allMimeTypes());
	this.view.setModelKeys(new HashSet<>(Arrays.asList("foo1", "foo2")));
	this.model.addAttribute("foo1", "bar1");
	this.model.addAttribute("foo2", "bar2");

	try {
		doRender();
		fail();
	}
	catch (IllegalStateException ex) {
		String message = ex.getMessage();
		assertTrue(message, message.contains("Map rendering is not supported"));
	}
}
 

private ResponseEntityResultHandler createHandler(HttpMessageWriter<?>... writers) {
	List<HttpMessageWriter<?>> writerList;
	if (ObjectUtils.isEmpty(writers)) {
		writerList = new ArrayList<>();
		writerList.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()));
		writerList.add(new ResourceHttpMessageWriter());
		writerList.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(new Jackson2JsonEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
	}
	else {
		writerList = Arrays.asList(writers);
	}
	RequestedContentTypeResolver resolver = new RequestedContentTypeResolverBuilder().build();
	return new ResponseEntityResultHandler(writerList, resolver);
}
 

private AbstractMessageWriterResultHandler initResultHandler(HttpMessageWriter<?>... writers) {
	List<HttpMessageWriter<?>> writerList;
	if (ObjectUtils.isEmpty(writers)) {
		writerList = new ArrayList<>();
		writerList.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
		writerList.add(new ResourceHttpMessageWriter());
		writerList.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(new Jackson2JsonEncoder()));
	}
	else {
		writerList = Arrays.asList(writers);
	}
	RequestedContentTypeResolver resolver = new RequestedContentTypeResolverBuilder().build();
	return new AbstractMessageWriterResultHandler(writerList, resolver) {};
}
 

/**
 * Return writers that support specific types.
 * @param forMultipart whether to returns writers for general use ("false"),
 * or for multipart requests only ("true"). Generally the two sets are the
 * same except for the multipart writer itself.
 */
@SuppressWarnings("unchecked")
final List<HttpMessageWriter<?>> getTypedWriters(boolean forMultipart) {
	if (!this.registerDefaults) {
		return Collections.emptyList();
	}
	List<HttpMessageWriter<?>> writers = new ArrayList<>();
	writers.add(new EncoderHttpMessageWriter<>(new ByteArrayEncoder()));
	writers.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
	writers.add(new EncoderHttpMessageWriter<>(new DataBufferEncoder()));
	writers.add(new ResourceHttpMessageWriter());
	writers.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()));
	// No client or server specific multipart writers currently..
	if (!forMultipart) {
		extendTypedWriters(writers);
	}
	if (protobufPresent) {
		Encoder<?> encoder = this.protobufEncoder != null ? this.protobufEncoder : new ProtobufEncoder();
		writers.add(new ProtobufHttpMessageWriter((Encoder) encoder));
	}
	return writers;
}
 

@Test
public void bodyClass() {
	String body = "foo";
	Publisher<String> publisher = Mono.just(body);
	ClientRequest result = ClientRequest.create(POST, URI.create("http://example.com"))
			.body(publisher, String.class).build();

	List<HttpMessageWriter<?>> messageWriters = new ArrayList<>();
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));

	ExchangeStrategies strategies = mock(ExchangeStrategies.class);
	when(strategies.messageWriters()).thenReturn(messageWriters);

	MockClientHttpRequest request = new MockClientHttpRequest(GET, "/");
	result.writeTo(request, strategies).block();
	assertNotNull(request.getBody());

	StepVerifier.create(request.getBody())
			.expectNextCount(1)
			.verifyComplete();
}
 

@Test
public void bodyParameterizedTypeReference() {
	String body = "foo";
	Publisher<String> publisher = Mono.just(body);
	ParameterizedTypeReference<String> typeReference = new ParameterizedTypeReference<String>() {};
	ClientRequest result = ClientRequest.create(POST, URI.create("http://example.com"))
			.body(publisher, typeReference).build();

	List<HttpMessageWriter<?>> messageWriters = new ArrayList<>();
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));

	ExchangeStrategies strategies = mock(ExchangeStrategies.class);
	when(strategies.messageWriters()).thenReturn(messageWriters);

	MockClientHttpRequest request = new MockClientHttpRequest(GET, "/");
	result.writeTo(request, strategies).block();
	assertNotNull(request.getBody());

	StepVerifier.create(request.getBody())
			.expectNextCount(1)
			.verifyComplete();
}
 

@Test
public void multipleMatchesNotSupported() throws Exception {
	this.view = new HttpMessageWriterView(CharSequenceEncoder.allMimeTypes());
	this.view.setModelKeys(new HashSet<>(Arrays.asList("foo1", "foo2")));
	this.model.addAttribute("foo1", "bar1");
	this.model.addAttribute("foo2", "bar2");

	try {
		doRender();
		fail();
	}
	catch (IllegalStateException ex) {
		String message = ex.getMessage();
		assertTrue(message, message.contains("Map rendering is not supported"));
	}
}
 

private ResponseEntityResultHandler createHandler(HttpMessageWriter<?>... writers) {
	List<HttpMessageWriter<?>> writerList;
	if (ObjectUtils.isEmpty(writers)) {
		writerList = new ArrayList<>();
		writerList.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()));
		writerList.add(new ResourceHttpMessageWriter());
		writerList.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(new Jackson2JsonEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
	}
	else {
		writerList = Arrays.asList(writers);
	}
	RequestedContentTypeResolver resolver = new RequestedContentTypeResolverBuilder().build();
	return new ResponseEntityResultHandler(writerList, resolver);
}
 

private AbstractMessageWriterResultHandler initResultHandler(HttpMessageWriter<?>... writers) {
	List<HttpMessageWriter<?>> writerList;
	if (ObjectUtils.isEmpty(writers)) {
		writerList = new ArrayList<>();
		writerList.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
		writerList.add(new ResourceHttpMessageWriter());
		writerList.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
		writerList.add(new EncoderHttpMessageWriter<>(new Jackson2JsonEncoder()));
	}
	else {
		writerList = Arrays.asList(writers);
	}
	RequestedContentTypeResolver resolver = new RequestedContentTypeResolverBuilder().build();
	return new AbstractMessageWriterResultHandler(writerList, resolver) {};
}
 

/**
 * Return writers that support specific types.
 * @param forMultipart whether to returns writers for general use ("false"),
 * or for multipart requests only ("true"). Generally the two sets are the
 * same except for the multipart writer itself.
 */
@SuppressWarnings("unchecked")
final List<HttpMessageWriter<?>> getTypedWriters(boolean forMultipart) {
	if (!this.registerDefaults) {
		return Collections.emptyList();
	}
	List<HttpMessageWriter<?>> writers = new ArrayList<>();
	writers.add(new EncoderHttpMessageWriter<>(new ByteArrayEncoder()));
	writers.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
	writers.add(new EncoderHttpMessageWriter<>(new DataBufferEncoder()));
	writers.add(new ResourceHttpMessageWriter());
	writers.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()));
	// No client or server specific multipart writers currently..
	if (!forMultipart) {
		extendTypedWriters(writers);
	}
	if (protobufPresent) {
		Encoder<?> encoder = this.protobufEncoder != null ? this.protobufEncoder : new ProtobufEncoder();
		writers.add(new ProtobufHttpMessageWriter((Encoder) encoder));
	}
	return writers;
}
 

@Bean
public RSocketStrategies rsocketStrategies() {
	return RSocketStrategies.builder()
			.decoder(StringDecoder.allMimeTypes())
			.encoder(CharSequenceEncoder.allMimeTypes())
			.dataBufferFactory(new LeakAwareNettyDataBufferFactory(PooledByteBufAllocator.DEFAULT))
			.build();
}
 

@Bean
public RSocketStrategies rsocketStrategies() {
	return RSocketStrategies.builder()
			.decoder(StringDecoder.allMimeTypes())
			.encoder(CharSequenceEncoder.allMimeTypes())
			.dataBufferFactory(new NettyDataBufferFactory(PooledByteBufAllocator.DEFAULT))
			.build();
}
 

@Before
public void setUp() {
	RSocketStrategies strategies = RSocketStrategies.builder()
			.decoder(StringDecoder.allMimeTypes())
			.encoder(CharSequenceEncoder.allMimeTypes())
			.build();
	this.rsocket = new TestRSocket();
	this.requester = RSocketRequester.wrap(this.rsocket, MimeTypeUtils.TEXT_PLAIN, strategies);
}
 

@Bean
public RSocketStrategies rsocketStrategies() {
	return RSocketStrategies.builder()
			.decoder(StringDecoder.allMimeTypes())
			.encoder(CharSequenceEncoder.allMimeTypes())
			.dataBufferFactory(new NettyDataBufferFactory(PooledByteBufAllocator.DEFAULT))
			.build();
}
 

@Test
public void bodyInserter() {
	String body = "foo";
	Publisher<String> publisher = Mono.just(body);

	Mono<EntityResponse<Publisher<String>>> result = EntityResponse.fromPublisher(publisher, String.class).build();

	MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("http://localhost"));

	ServerResponse.Context context = new ServerResponse.Context() {
		@Override
		public List<HttpMessageWriter<?>> messageWriters() {
			return Collections.singletonList(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
		}

		@Override
		public List<ViewResolver> viewResolvers() {
			return Collections.emptyList();
		}
	};
	StepVerifier.create(result)
			.consumeNextWith(response -> {
				StepVerifier.create(response.entity())
						.expectNext(body)
						.expectComplete()
						.verify();
				response.writeTo(exchange, context);
			})
			.expectComplete()
			.verify();

	assertNotNull(exchange.getResponse().getBody());
}
 

@Before
public void createContext() {
	final List<HttpMessageWriter<?>> messageWriters = new ArrayList<>();
	messageWriters.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()));
	messageWriters.add(new ResourceHttpMessageWriter());
	messageWriters.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
	Jackson2JsonEncoder jsonEncoder = new Jackson2JsonEncoder();
	messageWriters.add(new EncoderHttpMessageWriter<>(jsonEncoder));
	messageWriters.add(new ServerSentEventHttpMessageWriter(jsonEncoder));
	messageWriters.add(new FormHttpMessageWriter());
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
	messageWriters.add(new MultipartHttpMessageWriter(messageWriters));

	this.context = new BodyInserter.Context() {
		@Override
		public List<HttpMessageWriter<?>> messageWriters() {
			return messageWriters;
		}
		@Override
		public Optional<ServerHttpRequest> serverRequest() {
			return Optional.empty();
		}
		@Override
		public Map<String, Object> hints() {
			return hints;
		}
	};
	this.hints = new HashMap<>();
}
 

@Override
protected void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
	configurer.registerDefaults(false);
	configurer.customCodecs().decoder(StringDecoder.textPlainOnly());
	configurer.customCodecs().decoder(new Jaxb2XmlDecoder());
	configurer.customCodecs().encoder(CharSequenceEncoder.textPlainOnly());
	configurer.customCodecs().encoder(new Jaxb2XmlEncoder());
}
 

@Before
public void setup() throws Exception {
	List<HttpMessageWriter<?>> writerList = new ArrayList<>(5);
	writerList.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
	writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
	writerList.add(new ResourceHttpMessageWriter());
	writerList.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
	writerList.add(new EncoderHttpMessageWriter<>(new Jackson2JsonEncoder()));
	RequestedContentTypeResolver resolver = new RequestedContentTypeResolverBuilder().build();
	this.resultHandler = new ResponseBodyResultHandler(writerList, resolver);
}
 

/**
 * Constructor with a default list of part writers (String and Resource).
 */
public MultipartHttpMessageWriter() {
	this(Arrays.asList(
			new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()),
			new ResourceHttpMessageWriter()
	));
}
 

/**
 * Return writers that need to be at the end, after all others.
 */
List<HttpMessageWriter<?>> getCatchAllWriters() {
	if (!this.registerDefaults) {
		return Collections.emptyList();
	}
	List<HttpMessageWriter<?>> result = new ArrayList<>();
	result.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
	return result;
}
 

@Test // gh-22107
public void cancelWithEncoderHttpMessageWriterAndSingleValue() {
	CharSequenceEncoder encoder = CharSequenceEncoder.allMimeTypes();
	HttpMessageWriter<CharSequence> writer = new EncoderHttpMessageWriter<>(encoder);
	CancellingOutputMessage outputMessage = new CancellingOutputMessage(this.bufferFactory);

	writer.write(Mono.just("foo"), ResolvableType.forType(String.class), MediaType.TEXT_PLAIN,
			outputMessage, Collections.emptyMap()).block(Duration.ofSeconds(5));
}
 

@Test
public void defaultAndCustomWriters() {
	Encoder<?> customEncoder1 = mock(Encoder.class);
	Encoder<?> customEncoder2 = mock(Encoder.class);

	given(customEncoder1.canEncode(ResolvableType.forClass(Object.class), null)).willReturn(false);
	given(customEncoder2.canEncode(ResolvableType.forClass(Object.class), null)).willReturn(true);

	HttpMessageWriter<?> customWriter1 = mock(HttpMessageWriter.class);
	HttpMessageWriter<?> customWriter2 = mock(HttpMessageWriter.class);

	given(customWriter1.canWrite(ResolvableType.forClass(Object.class), null)).willReturn(false);
	given(customWriter2.canWrite(ResolvableType.forClass(Object.class), null)).willReturn(true);

	this.configurer.customCodecs().encoder(customEncoder1);
	this.configurer.customCodecs().encoder(customEncoder2);

	this.configurer.customCodecs().writer(customWriter1);
	this.configurer.customCodecs().writer(customWriter2);

	List<HttpMessageWriter<?>> writers = this.configurer.getWriters();

	assertEquals(14, writers.size());
	assertSame(customEncoder1, getNextEncoder(writers));
	assertSame(customWriter1, writers.get(this.index.getAndIncrement()));
	assertEquals(ByteArrayEncoder.class, getNextEncoder(writers).getClass());
	assertEquals(ByteBufferEncoder.class, getNextEncoder(writers).getClass());
	assertEquals(DataBufferEncoder.class, getNextEncoder(writers).getClass());
	assertEquals(ResourceHttpMessageWriter.class, writers.get(index.getAndIncrement()).getClass());
	assertEquals(CharSequenceEncoder.class, getNextEncoder(writers).getClass());
	assertEquals(ProtobufHttpMessageWriter.class, writers.get(index.getAndIncrement()).getClass());
	assertSame(customEncoder2, getNextEncoder(writers));
	assertSame(customWriter2, writers.get(this.index.getAndIncrement()));
	assertEquals(Jackson2JsonEncoder.class, getNextEncoder(writers).getClass());
	assertEquals(Jackson2SmileEncoder.class, getNextEncoder(writers).getClass());
	assertEquals(Jaxb2XmlEncoder.class, getNextEncoder(writers).getClass());
	assertEquals(CharSequenceEncoder.class, getNextEncoder(writers).getClass());
}
 

@Test
public void bodyInserter() {
	String body = "foo";
	Publisher<String> publisher = Mono.just(body);

	Mono<EntityResponse<Publisher<String>>> result = EntityResponse.fromPublisher(publisher, String.class).build();

	MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("http://localhost"));

	ServerResponse.Context context = new ServerResponse.Context() {
		@Override
		public List<HttpMessageWriter<?>> messageWriters() {
			return Collections.singletonList(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
		}

		@Override
		public List<ViewResolver> viewResolvers() {
			return Collections.emptyList();
		}
	};
	StepVerifier.create(result)
			.consumeNextWith(response -> {
				StepVerifier.create(response.entity())
						.expectNext(body)
						.expectComplete()
						.verify();
				response.writeTo(exchange, context);
			})
			.expectComplete()
			.verify();

	assertNotNull(exchange.getResponse().getBody());
}
 

@Before
public void createContext() {
	final List<HttpMessageWriter<?>> messageWriters = new ArrayList<>();
	messageWriters.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()));
	messageWriters.add(new ResourceHttpMessageWriter());
	messageWriters.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
	Jackson2JsonEncoder jsonEncoder = new Jackson2JsonEncoder();
	messageWriters.add(new EncoderHttpMessageWriter<>(jsonEncoder));
	messageWriters.add(new ServerSentEventHttpMessageWriter(jsonEncoder));
	messageWriters.add(new FormHttpMessageWriter());
	messageWriters.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
	messageWriters.add(new MultipartHttpMessageWriter(messageWriters));

	this.context = new BodyInserter.Context() {
		@Override
		public List<HttpMessageWriter<?>> messageWriters() {
			return messageWriters;
		}
		@Override
		public Optional<ServerHttpRequest> serverRequest() {
			return Optional.empty();
		}
		@Override
		public Map<String, Object> hints() {
			return hints;
		}
	};
	this.hints = new HashMap<>();
}
 

@Override
protected void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
	configurer.registerDefaults(false);
	configurer.customCodecs().decoder(StringDecoder.textPlainOnly());
	configurer.customCodecs().decoder(new Jaxb2XmlDecoder());
	configurer.customCodecs().encoder(CharSequenceEncoder.textPlainOnly());
	configurer.customCodecs().encoder(new Jaxb2XmlEncoder());
}
 

@Before
public void setup() throws Exception {
	List<HttpMessageWriter<?>> writerList = new ArrayList<>(5);
	writerList.add(new EncoderHttpMessageWriter<>(new ByteBufferEncoder()));
	writerList.add(new EncoderHttpMessageWriter<>(CharSequenceEncoder.allMimeTypes()));
	writerList.add(new ResourceHttpMessageWriter());
	writerList.add(new EncoderHttpMessageWriter<>(new Jaxb2XmlEncoder()));
	writerList.add(new EncoderHttpMessageWriter<>(new Jackson2JsonEncoder()));
	RequestedContentTypeResolver resolver = new RequestedContentTypeResolverBuilder().build();
	this.resultHandler = new ResponseBodyResultHandler(writerList, resolver);
}
 

/**
 * Constructor with a default list of part writers (String and Resource).
 */
public MultipartHttpMessageWriter() {
	this(Arrays.asList(
			new EncoderHttpMessageWriter<>(CharSequenceEncoder.textPlainOnly()),
			new ResourceHttpMessageWriter()
	));
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 类方法
 同包方法