use of com.avaloq.tools.ddk.xtext.export.export.Attribute in project dsl-devkit by dsldevkit.
the class ExportJavaValidator method checkExportFieldUniqueness.
/**
* Checks that the exports don't have overlapping features, as a feature export is inherited by the export of subtypes.
*
* @param context
* model to check
*/
@Check
public void checkExportFieldUniqueness(final ExportModel context) {
UniquenessJavaValidationHelper<Attribute> helper = new UniquenessJavaValidationHelper<Attribute>(NameFunctions.fromFeature(ExportPackage.Literals.ATTRIBUTE__ATTRIBUTE), getMessageAcceptor()) {
@Override
public String getMessage(final Attribute attribute) {
return "duplicate found: " + attribute.getAttribute().getName();
}
};
UniquenessJavaValidationHelper<UserData> helper2 = new UniquenessJavaValidationHelper<UserData>(NameFunctions.fromFeature(ExportPackage.Literals.USER_DATA__NAME), getMessageAcceptor());
for (Export export : context.getExports()) {
helper.errorOnDuplicates(export.getAttributes(), ExportPackage.Literals.ATTRIBUTE__ATTRIBUTE);
helper2.errorOnDuplicates(export.getUserData(), ExportPackage.Literals.USER_DATA__NAME);
}
}
Aggregations