All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.intarsys.tools.locator.MappedLocatorLookup Maven / Gradle / Ivy

There is a newer version: 4.11
Show newest version
package de.intarsys.tools.locator;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class MappedLocatorLookup extends AbstractLocatorLookup {

	private Map locators = new HashMap();

	public void addMap(String name, ILocator locator) {
		locators.put(name, locator);
	}

	public ILocator createLocator(String location) throws IOException {
		ILocator lookup = locators.get(location);
		if (lookup != null) {
			return lookup;
		}
		throw new FileNotFoundException("locator '" + location + "' not found");
	}

	public Map getMaps() {
		return new HashMap(locators);
	}

	public void removeMap(String name) {
		locators.remove(name);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy