|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2012 the original author or authors. |
|
|
|
* Copyright 2002-2014 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -25,8 +25,8 @@ import org.springframework.core.convert.TypeDescriptor; |
|
|
|
import org.springframework.core.convert.converter.ConditionalGenericConverter; |
|
|
|
import org.springframework.core.convert.converter.ConditionalGenericConverter; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Converts an Object to a single-element Array containing the Object. |
|
|
|
* Converts an Object to a single-element array containing the Object. |
|
|
|
* Will convert the Object to the target Array's component type if necessary. |
|
|
|
* Will convert the Object to the target array's component type if necessary. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Keith Donald |
|
|
|
* @author Keith Donald |
|
|
|
* @since 3.0 |
|
|
|
* @since 3.0 |
|
|
|
@ -35,10 +35,12 @@ final class ObjectToArrayConverter implements ConditionalGenericConverter { |
|
|
|
|
|
|
|
|
|
|
|
private final ConversionService conversionService; |
|
|
|
private final ConversionService conversionService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ObjectToArrayConverter(ConversionService conversionService) { |
|
|
|
public ObjectToArrayConverter(ConversionService conversionService) { |
|
|
|
this.conversionService = conversionService; |
|
|
|
this.conversionService = conversionService; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Set<ConvertiblePair> getConvertibleTypes() { |
|
|
|
public Set<ConvertiblePair> getConvertibleTypes() { |
|
|
|
return Collections.singleton(new ConvertiblePair(Object.class, Object[].class)); |
|
|
|
return Collections.singleton(new ConvertiblePair(Object.class, Object[].class)); |
|
|
|
|