blob: 482942706fd2537d9c42afb58553e31ff8bac874 [file] [log] [blame]
// Copied from org.eclipse.ocl.examples.test.xtext.PivotDocumentationExamples.java
// accumulate the document constraints in constraintMap and print all constraints
Map<String, ExpressionInOCL> constraintMap = new HashMap<String, ExpressionInOCL>();
for (TreeIterator<EObject> tit = asResource.getAllContents(); tit.hasNext(); ) {
EObject next = tit.next();
if (next instanceof Constraint) {
Constraint constraint = (Constraint)next;
ExpressionInOCL expressionInOCL = ocl.getSpecification(constraint);
if (expressionInOCL != null) {
String name = constraint.getName();
if (name != null) {
constraintMap.put(name, expressionInOCL);
debugPrintf("%s: %s%n\n", name,
expressionInOCL.getOwnedBody());
}
}
}
}