use of org.bndtools.api.IValidator in project bndtools by bndtools.
the class MarkerSupport method validate.
void validate(Project model) throws Exception {
List<IValidator> validators = loadValidators();
if (validators != null) {
for (IValidator v : validators) {
try {
if (v instanceof IProjectValidator) {
((IProjectValidator) v).validateProject(model);
} else {
for (Builder builder : model.getSubBuilders()) {
IStatus status = v.validate(builder);
report(builder, status);
model.getInfo(builder);
}
}
} catch (Exception e) {
logger.logError("Validator error", e);
}
}
}
}
use of org.bndtools.api.IValidator 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