use of org.eclipse.core.runtime.IConfigurationElement in project bndtools by bndtools.
the class BuildErrorDetailsHandlers method findHandler.
public BuildErrorDetailsHandler findHandler(String type) {
if (type == null)
return DefaultBuildErrorDetailsHandler.INSTANCE;
BuildErrorDetailsHandler handler = cache.get(type);
if (handler != null)
return handler;
handler = DefaultBuildErrorDetailsHandler.INSTANCE;
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Plugin.PLUGIN_ID, "buildErrorDetailsHandlers");
if (elements != null) {
for (IConfigurationElement element : elements) {
if (type.equals(element.getAttribute("typeMatch"))) {
try {
handler = (BuildErrorDetailsHandler) element.createExecutableExtension("class");
break;
} catch (Exception e) {
logger.logError("Error instantiating build error handler for type " + type, e);
}
}
}
}
BuildErrorDetailsHandler mapped = cache.putIfAbsent(type, handler);
if (mapped != null)
return mapped;
return handler;
}
use of org.eclipse.core.runtime.IConfigurationElement in project bndtools by bndtools.
the class MarkerSupport method loadValidators.
static List<IValidator> loadValidators() {
List<IValidator> validators = null;
IConfigurationElement[] validatorElems = Platform.getExtensionRegistry().getConfigurationElementsFor(CORE_PLUGIN_ID, "validators");
if (validatorElems != null && validatorElems.length > 0) {
validators = new ArrayList<IValidator>(validatorElems.length);
for (IConfigurationElement elem : validatorElems) {
try {
validators.add((IValidator) elem.createExecutableExtension("class"));
} catch (Exception e) {
logger.logError("Unable to instantiate validator: " + elem.getAttribute("name"), e);
}
}
}
return validators;
}
Aggregations