Turned ByteBufferConverter's visibility to package level

This commit is contained in:
Juergen Hoeller 2013-10-04 22:52:14 +02:00
parent 3fad0fa432
commit bd4c64af04
2 changed files with 5 additions and 5 deletions

View File

@ -30,8 +30,9 @@ import org.springframework.core.convert.converter.ConditionalGenericConverter;
* any type that the {@link ConversionService} support via {@code byte[]}. * any type that the {@link ConversionService} support via {@code byte[]}.
* *
* @author Phillip Webb * @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); private static final TypeDescriptor BYTE_BUFFER_TYPE = TypeDescriptor.valueOf(ByteBuffer.class);

View File

@ -17,7 +17,6 @@
package org.springframework.web.socket.adapter; package org.springframework.web.socket.adapter;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import javax.websocket.DecodeException; import javax.websocket.DecodeException;
import javax.websocket.Decoder; import javax.websocket.Decoder;
import javax.websocket.EncodeException; import javax.websocket.EncodeException;
@ -28,13 +27,14 @@ import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.ConverterNotFoundException; import org.springframework.core.convert.ConverterNotFoundException;
import org.springframework.core.convert.converter.Converter; 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.core.convert.support.GenericConversionService;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
@ -188,8 +188,7 @@ public class ConvertingEncoderDecoderSupportTests {
@Bean @Bean
public ConversionService webSocketConversionService() { public ConversionService webSocketConversionService() {
GenericConversionService conversionService = new GenericConversionService(); GenericConversionService conversionService = new DefaultConversionService();
conversionService.addConverter(new ByteBufferConverter(conversionService));
conversionService.addConverter(new MyTypeToStringConverter()); conversionService.addConverter(new MyTypeToStringConverter());
conversionService.addConverter(new MyTypeToBytesConverter()); conversionService.addConverter(new MyTypeToBytesConverter());
conversionService.addConverter(new StringToMyTypeConverter()); conversionService.addConverter(new StringToMyTypeConverter());