fr.setPlugin(plugin);
fr.setPackage(packageBase);
fr.setName(name);
fr.setParent(root);
ExtensionFile file = ParseFacade.file(new InputStreamReader(in), checkFile);
for (Check check : file.getChecks()) {
// map the Identifier (the context) to an EMFClass
EMFClass identifier = mapOAWIdentifier(root, check.getType());
if (identifier == null)
continue; // unidentified type (e.g. emf::EObject)
// make a new Constraint for this check
Constraint constraint = factory.createConstraint();
constraint.setConstraint(check.getConstraint().toString());
constraint.setType( check.isErrorCheck() ? ConstraintType.ERROR : ConstraintType.WARNING );
constraint.setMessage( check.getMsg().toString() );
// make a new FileReference
FileLineReference line = factory.createFileLineReference();
line.setFile(fr);
line.setLine(check.getLine());
constraint.setReference(line);
// add this constraint
identifier.getConstraints().add(constraint);
}
// set number of constraints
fr.setUniqueConstraints(file.getChecks().size());
}