Revision 33030 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/LayerFactory.java

View differences:

LayerFactory.java
147 147
		try{	
148 148
			Class layerClass = this.getLayerClassFor(dataStore);
149 149
			if (layerClass == null) {
150
				throw new LoadLayerException("No_layer_class_to_use",
151
						new Exception());
150
				throw new CantRetrieveLayerByStoreException(layerName,dataStore.getName());
152 151
			}
153 152
			FLayer layer;
154 153
			try {
......
159 158
				throw new LoadLayerException(layerName, e);
160 159
			}
161 160

  
161
			layer.setName(layerName);
162 162
			((SingleLayer) layer).setDataStore(dataStore);
163
			layer.setName(layerName);
164 163
			IProjection proj = (IProjection)dataStore.getDynValue(FeatureStore.METADATA_CRS);
165 164
			if (proj != null) {
166 165
				layer.setProjection(proj);
167 166
			}
168

  
169

  
170 167
			return layer;
171 168
		} catch (Exception e) {
172 169
			throw new LoadLayerException(layerName,e);
173 170
		}
174 171
	}
172
	
173
	private class CantRetrieveLayerByStoreException extends LoadLayerException {
175 174

  
175
		/**
176
		 * 
177
		 */
178
		private static final long serialVersionUID = 1442450896900126712L;
179

  
180
		CantRetrieveLayerByStoreException(String layerName, String storeName) {
181
			super(
182
				"Can't retrieve the class leyer of %(layer) to use for store %(store).",
183
				null,
184
				"_Cant_retrieve_the_class_leyer_of_XlayerX_to_use_for_store_XstoreX",
185
				serialVersionUID
186
			);
187
			setValue("layer", layerName);
188
			setValue("store", storeName);
189
		}
190
	}
191

  
176 192
}

Also available in: Unified diff