de.intarsys.tools.locator.StandardLocatorOutlet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of isrt Show documentation
Show all versions of isrt Show documentation
The basic runtime tools and interfaces for intarsys components.
package de.intarsys.tools.locator;
import java.io.IOException;
import java.util.Map;
public class StandardLocatorOutlet extends CommonLocatorFactory implements
ILocatorOutlet {
private ILocatorFactory defaultLocatorFactory = new FileLocatorFactory();
public StandardLocatorOutlet() {
registerLocatorFactory("file", new FileLocatorFactory());
}
public final ILocator createLocator(String location) throws IOException {
String[] parts = location.split("\\:\\:", 2);
if (parts.length == 1) {
return getDefaultLocatorFactory().createLocator(location);
}
ILocatorFactory factory = LocatorOutlet.get().lookupLocatorFactory(
parts[0]);
if (factory != null) {
return factory.createLocator(parts[1]);
}
throw new IOException("locator format " + parts[0] + " not supported");
}
public ILocatorFactory getDefaultLocatorFactory() {
return defaultLocatorFactory;
}
public Map getLocatorFactories() {
return null;
}
public ILocatorFactory lookupLocatorFactory(String format) {
return null;
}
public void registerLocatorFactory(String format, ILocatorFactory factory) {
}
public void setDefaultLocatorFactory(ILocatorFactory defaultLocatorFactory) {
defaultLocatorFactory = defaultLocatorFactory;
}
public void unregisterLocatorFactory(String format) {
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy