Revision 23303 branches/v2_0_0_prep/libraries/libFMap_data/src/org/gvsig/fmap/data/feature/AbstractFeatureStore.java

View differences:

AbstractFeatureStore.java
5 5
import java.util.Iterator;
6 6
import java.util.List;
7 7

  
8
import org.gvsig.tools.exception.BaseException;
9 8
import org.gvsig.fmap.data.CloseException;
10 9
import org.gvsig.fmap.data.DataCollection;
11 10
import org.gvsig.fmap.data.DataException;
......
34 33
import org.gvsig.fmap.data.operation.DataStoreOperationNotSupportedException;
35 34
import org.gvsig.fmap.geom.Geometry;
36 35
import org.gvsig.fmap.geom.primitive.Envelope;
36
import org.gvsig.tools.exception.BaseException;
37 37
import org.gvsig.tools.observer.ComplexNotification;
38 38
import org.gvsig.tools.observer.DefaultObservable;
39 39
import org.gvsig.tools.observer.Observable;
......
898 898
		return this.getClass().getName();
899 899
	}
900 900

  
901
	protected FeatureType checkFeatureTypeForCollection(FeatureType fType)
902
			throws DataException {
903
		FeatureType defType = this.getDefaultFeatureType();
904
		if (fType == null || fType.equals(defType)) {
905
			//TODO we must return a copy of Ftype but there are probles with
906
			// weakRefs of Ftype of Attributes in edition mode
907
			//			return defType.getSubFeatureType(null);
908
			return defType;
909
		}
910
		if (fType.isSubtypeOf(defType)) {
911
			return fType;
912
		}
913
		Iterator iter = this.getFeatureTypes().iterator();
914
		FeatureType tmpType;
915
		while (iter.hasNext()) {
916
			tmpType = (FeatureType) iter.next();
917
			if (fType.isSubtypeOf(tmpType)) {
918
				return fType;
919
			}
920

  
921
		}
922
		throw new ReadException("invalid type", this.getName());
923
	}
901 924
}

Also available in: Unified diff