Revision 44128 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/impl/DefaultDataManager.java

View differences:

DefaultDataManager.java
5 5
import java.net.URL;
6 6
import java.net.URLClassLoader;
7 7
import java.util.ArrayList;
8
import java.util.Collections;
8 9
import java.util.HashMap;
9 10
import java.util.List;
10 11
import java.util.Map;
......
36 37
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
37 38
import org.gvsig.fmap.dal.expressionevaluator.FeatureAttributeEmulatorExpression;
38 39
import org.gvsig.fmap.dal.expressionevaluator.FeatureSymbolTable;
40
import org.gvsig.fmap.dal.feature.DataProfile;
39 41
import org.gvsig.fmap.dal.feature.EditableFeatureType;
40 42
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
41 43
import org.gvsig.fmap.dal.feature.FeatureQuery;
......
135 137

  
136 138
    private ClassLoader resourcesLoader = null;
137 139

  
140
    private List<DataProfile> dataProfiles;
141
    
138 142
    public DefaultDataManager() {
139 143
        this.registers = new Registers();
140 144
        this.defaultDataIndexProviders = new HashMap<>();
......
930 934
        return emulator;
931 935
    }
932 936

  
937
    @Override
938
    public void registerDataProfile(DataProfile profile) {
939
        if( profile==null ) {
940
            return;
941
        }
942
        if( this.dataProfiles==null ) {
943
            this.dataProfiles = new ArrayList<>();
944
            this.dataProfiles.add(profile);
945
            return;
946
        }
947
        for (DataProfile theProfile : this.dataProfiles) {
948
            if( theProfile.getName().equalsIgnoreCase(profile.getName()) ) {
949
                return;
950
            }
951
        }
952
        this.dataProfiles.add(profile);
953
    }
933 954

  
955
    @Override
956
    public List<DataProfile> getDataProfiles() {
957
        if( this.dataProfiles==null ) {
958
            return null;
959
        }
960
        return Collections.unmodifiableList(this.dataProfiles);
961
    }
962

  
963
    @Override
964
    public DataProfile getDataProfile(String name) {
965
        if( StringUtils.isBlank(name) ) {
966
            return null;
967
        }
968
        for (DataProfile theProfile : this.dataProfiles) {
969
            if( name.equalsIgnoreCase(theProfile.getName()) ) {
970
                return theProfile;
971
            }
972
        }
973
        return null;
974
    }
975

  
976

  
977
    
934 978
}

Also available in: Unified diff