Revision 44669 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProvider.java

View differences:

SimpleSequentialReaderStoreProvider.java
79 79
import org.gvsig.fmap.geom.primitive.Point;
80 80
import org.gvsig.fmap.geom.type.GeometryType;
81 81
import org.gvsig.tools.ToolsLocator;
82
import org.gvsig.tools.dataTypes.Coercion;
83
import org.gvsig.tools.dataTypes.CoercionContext;
82 84
import org.gvsig.tools.dataTypes.CoercionException;
83 85
import org.gvsig.tools.dataTypes.DataTypesManager;
84
import org.gvsig.tools.dataTypes.DataTypesManager.Coercion;
85
import org.gvsig.tools.dataTypes.DataTypesManager.CoercionWithLocale;
86 86
import org.gvsig.tools.dispose.Disposable;
87 87
import org.gvsig.tools.dispose.DisposeUtils;
88 88
import org.gvsig.tools.dynobject.Tags;
......
1109 1109
            readerData.setFeatureTypes(ftypes, ftype);
1110 1110

  
1111 1111
            Coercion coercion[] = new Coercion[ftype.size()];
1112
            CoercionContext coercionContext[] = new CoercionContext[ftype.size()];
1112 1113
            int sizes[] = new int[ftype.size()];
1113 1114
            for ( int i = 0; i < ftype.size(); i++ ) {
1114 1115
                sizes[i] = -1;
1115 1116
                FeatureAttributeDescriptor ad = ftype.getAttributeDescriptor(i);
1116
                coercion[i] = ad.getDataType().getCoercion();
1117
                coercion[i] = ad.getCoercion();
1118
                coercionContext[i] = ad.getCoercionContext();
1117 1119
                if ( ad.getDataType().getType() == DataTypes.STRING ) {
1118 1120
                    if ( ad.getSize() == 0 ) {
1119 1121
                        // Es un string y no tiene un size asignado.
......
1154 1156
                        if( rawvalue instanceof String && StringUtils.isBlank((String)rawvalue) ) {
1155 1157
                            rawvalue = null;
1156 1158
                        }
1157
                        Object value;
1158
                        if ( locale != null && coercion[i] instanceof CoercionWithLocale ) {
1159
                            value = ((CoercionWithLocale) (coercion[i])).coerce(rawvalue, locale);
1160
                        } else {
1161
                            value = coercion[i].coerce(rawvalue);
1162
                        }
1159
                        Object value = coercion[i].coerce(rawvalue, coercionContext[i]);
1163 1160
                        feature.set(i, value);
1164 1161
                        if ( sizes[i] >= 0 && value != null ) {
1165 1162
                            int x = ((String) value).length();

Also available in: Unified diff