提交 bd4c64af 编写于 作者: J Juergen Hoeller

Turned ByteBufferConverter's visibility to package level

上级 3fad0fa4
......@@ -30,8 +30,9 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter;
* any type that the {@link ConversionService} support via {@code byte[]}.
*
* @author Phillip Webb
* @since 4.0
*/
public class ByteBufferConverter implements ConditionalGenericConverter {
final class ByteBufferConverter implements ConditionalGenericConverter {
private static final TypeDescriptor BYTE_BUFFER_TYPE = TypeDescriptor.valueOf(ByteBuffer.class);
......
......@@ -17,7 +17,6 @@
package org.springframework.web.socket.adapter;
import java.nio.ByteBuffer;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.EncodeException;
......@@ -28,13 +27,14 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.ConverterNotFoundException;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.support.ByteBufferConverter;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
......@@ -188,8 +188,7 @@ public class ConvertingEncoderDecoderSupportTests {
@Bean
public ConversionService webSocketConversionService() {
GenericConversionService conversionService = new GenericConversionService();
conversionService.addConverter(new ByteBufferConverter(conversionService));
GenericConversionService conversionService = new DefaultConversionService();
conversionService.addConverter(new MyTypeToStringConverter());
conversionService.addConverter(new MyTypeToBytesConverter());
conversionService.addConverter(new StringToMyTypeConverter());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册