Revision 37297 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/impl/DefaultDataManager.java

View differences:

DefaultDataManager.java
44 44
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
45 45
import org.gvsig.fmap.dal.feature.EditableFeatureType;
46 46
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
47
import org.gvsig.fmap.dal.feature.FeatureAttributeGetter;
47 48
import org.gvsig.fmap.dal.feature.FeatureQuery;
48 49
import org.gvsig.fmap.dal.feature.FeatureStore;
49 50
import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory;
......
126 127
        "Data.manager.providers.factory";
127 128
    final static private String DATA_MANAGER_STORE_PROVIDER_FACTORY_DESCRIPTION =
128 129
        "DAL store provider factories";
130
    
131
    final static private String DATA_MANAGER_FEATURE_ATTTRIBUTE_GETTER = 
132
        "Data.manager.feature.attribute.getter";
133
    final static private String DATA_MANAGER_FEATURE_ATTTRIBUTE_GETTER_DESCRIPTION = 
134
        "DAL feature attribute getters";
129 135

  
130 136
    /** This map contains the name of the default provider for each data type */
131 137
    private Map defaultDataIndexProviders;
......
878 884
        }
879 885
        return dataTypes;
880 886
    }
887
    
888
    public void registerFeatureAttributeGetter(String name, Class clazz) {
889
        if (name == null || clazz == null) {           
890
            throw new IllegalArgumentException("Any parameters can be null");
891
        }
892
        if(!(FeatureAttributeGetter.class.isAssignableFrom(clazz))) {            
893
            throw new IllegalArgumentException(
894
                "Not supported implemtation: name=" + name
895
                + " class=" + clazz.getName());
896
        }
897
    }
898
    
899
    public FeatureAttributeGetter createFeatureAttributeGetter(String name) throws InitializeException {
900
        if (name == null) {           
901
            throw new IllegalArgumentException("The parameter can not be null");
902
        }
903

  
904
        try{
905
            return (FeatureAttributeGetter) ToolsLocator.getExtensionPointManager().get(DATA_MANAGER_FEATURE_ATTTRIBUTE_GETTER).create(name);
906
        } catch (InstantiationException e) {
907
            throw new InitializeException("FeatureAttributeGetter", e);
908
        } catch (IllegalAccessException e) {
909
            throw new InitializeException("FeatureAttributeGetter", e);
910
        }
911
    }
881 912
}

Also available in: Unified diff