class GeoToolsLayerBeanFactory extends BaseVectorLayerBeanFactory {

	@Override
	public List<BeanDefinitionHolder> createBeans(Map<String, Object> parameters) throws RuntimeConfigException {
		Resource resource = null;
		if (checkString(LOCATION, parameters) != Priority.NONE) {
			try {
				resource = resourceService.find((String) parameters.get(LOCATION));
				parameters.put(URL, resource.getURL().toExternalForm());
			} catch (Exception e) {
				throw new RuntimeConfigException(RuntimeConfigException.BAD_PARAMETER, LOCATION, e.getMessage());
			}
		}
		if (checkClass(LAYER_INFO, VectorLayerInfo.class, parameters) == Priority.NONE) {
			// generate the layer info
			try {
				VectorLayerInfo info = generateDefaultInfo(resource.getURL());
				parameters.put(LAYER_INFO, info);
			} catch (Exception e) {
				throw new RuntimeConfigException(RuntimeConfigException.BAD_PARAMETER, LOCATION, e.getMessage());
			}
		}
		// add styles or replace them if they were passed to us
		if (checkCollection(STYLE_INFO, NamedStyleInfo.class, parameters) == Priority.NONE) {
			VectorLayerInfo info = getObject(LAYER_INFO, parameters);
			parameters.put(STYLE_INFO, info.getNamedStyleInfos());
		} else {
			VectorLayerInfo info = getObject(LAYER_INFO, parameters);
			Collection<NamedStyleInfo> styles = getCollection(STYLE_INFO, parameters);
			info.setNamedStyleInfos(new ArrayList<NamedStyleInfo>(styles));
		}
		return super.createBeans(parameters);
	}

	protected  GeoToolsLayerBeanFactory();

}