コード例 #1
0
 /**
  * Turns a constraint container into string representations.
  *
  * @param constraints the constraints
  * @return the string representations
  */
 String[] toConstraints(ContainerValue constraints) {
   List<String> tmp = new ArrayList<String>();
   AbstractVariable decl = getVariable().getDeclaration();
   IModelElement context = decl;
   while (null != context && !(context instanceof Compound)) {
     context = context.getParent();
   }
   if (!(context instanceof Compound)) {
     context = decl;
   }
   for (int t = 0; t < constraints.getElementSize(); t++) {
     Value cVal = constraints.getElement(t);
     if (cVal instanceof ConstraintValue) {
       ConstraintValue val = (ConstraintValue) cVal;
       tmp.add(StringProvider.toIvmlString(val.getValue(), context));
     }
   }
   return tmp.toArray(new String[tmp.size()]);
 }