javadoc
This commit is contained in:
@@ -20,6 +20,13 @@ import java.lang.reflect.Array;
|
||||
import org.springframework.binding.convert.ConversionExecutor;
|
||||
import org.springframework.binding.convert.ConversionService;
|
||||
|
||||
/**
|
||||
* Special two-way converter that converts an object to an single-element array. Supports type conversion of the
|
||||
* individual array elements; for example, the ability to convert a String to an Integer[]. Mainly used internally by
|
||||
* {@link ConversionService} implementations.
|
||||
*
|
||||
* @author Keith Donald
|
||||
*/
|
||||
public class ObjectToArray implements TwoWayConverter {
|
||||
|
||||
private ConversionService conversionService;
|
||||
|
||||
@@ -17,10 +17,19 @@ package org.springframework.binding.convert.converters;
|
||||
|
||||
import java.beans.PropertyEditor;
|
||||
|
||||
/**
|
||||
* Adapts a PropertyEditor to the {@link TwoWayConverter} interface.
|
||||
* @author Keith Donald
|
||||
*/
|
||||
public class PropertyEditorConverter extends StringToObject {
|
||||
|
||||
private PropertyEditor propertyEditor;
|
||||
|
||||
/**
|
||||
* Creates a new property editor converter.
|
||||
* @param propertyEditor the property editor to adapt
|
||||
* @param targetClass the {@link PropertyEditor#getValue() value class} this property editor converts to from string
|
||||
*/
|
||||
public PropertyEditorConverter(PropertyEditor propertyEditor, Class targetClass) {
|
||||
super(targetClass);
|
||||
this.propertyEditor = propertyEditor;
|
||||
|
||||
@@ -15,6 +15,13 @@
|
||||
*/
|
||||
package org.springframework.binding.convert.converters;
|
||||
|
||||
/**
|
||||
* A converter that calls the {@link TwoWayConverter#convertTargetToSourceClass(Object, Class)} on a target
|
||||
* {@link TwoWayConverter} instance. Useful for invoking the "reverse" (target-to-source) conversion algorithm using the
|
||||
* standard Converter contract.
|
||||
*
|
||||
* @author Keith Donald
|
||||
*/
|
||||
public class ReverseConverter implements Converter {
|
||||
|
||||
private TwoWayConverter converter;
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.binding.convert.ConversionService;
|
||||
import org.springframework.binding.mapping.Mapper;
|
||||
import org.springframework.binding.mapping.Mapping;
|
||||
import org.springframework.binding.mapping.MappingResults;
|
||||
@@ -31,7 +30,6 @@ import org.springframework.core.style.ToStringCreator;
|
||||
* Generic mapper implementation that allows mappings to be configured programatically.
|
||||
*
|
||||
* @see #addMapping(DefaultMapping)
|
||||
* @see #setConversionService(ConversionService)
|
||||
* @author Keith Donald
|
||||
*/
|
||||
public class DefaultMapper implements Mapper {
|
||||
|
||||
Reference in New Issue
Block a user