use of org.eclipse.xtext.validation.AbstractValidationMessageAcceptor in project xtext-core by eclipse.
the class XtextValidator method checkGeneratedPackage.
public void checkGeneratedPackage(GeneratedMetamodel metamodel, Diagnostician diagnostician, Map<?, ?> params) {
EPackage pack = metamodel.getEPackage();
if (pack != null) {
Diagnostic packageValidationResult = diagnostician.validate(pack, params);
ValidationMessageAcceptor filter = new AbstractValidationMessageAcceptor() {
Set<Triple<EObject, EStructuralFeature, String>> accepted = Sets.newHashSet();
@Override
public void acceptInfo(String message, EObject object, EStructuralFeature feature, int index, String code, String... issueData) {
if (accepted.add(Tuples.create(object, feature, message))) {
XtextValidator.this.getMessageAcceptor().acceptInfo(message, object, feature, index, code, issueData);
}
}
@Override
public void acceptWarning(String message, EObject object, EStructuralFeature feature, int index, String code, String... issueData) {
if (accepted.add(Tuples.create(object, feature, message))) {
XtextValidator.this.getMessageAcceptor().acceptWarning(message, object, feature, index, code, issueData);
}
}
@Override
public void acceptError(String message, EObject object, EStructuralFeature feature, int index, String code, String... issueData) {
if (accepted.add(Tuples.create(object, feature, message))) {
XtextValidator.this.getMessageAcceptor().acceptError(message, object, feature, index, code, issueData);
}
}
};
propageValidationResult(packageValidationResult, metamodel, filter);
}
}
Aggregations