@SuppressWarnings("unchecked")
  Collection<AbstractClass> getAllClassesFromReferedModels(FormCollection fc) {
    Set<AbstractClass> existing = new HashSet<AbstractClass>();
    Set<AbstractClass> all = new HashSet<AbstractClass>();

    EList<FormContainer> forms = fc.getForms();
    for (FormContainer formContainer : forms) {
      if (formContainer instanceof ClassReference) {
        ClassReference cr = (ClassReference) formContainer;
        AbstractClass real_class = cr.getReal_class();
        if (real_class instanceof Clazz) {
          existing.add(real_class);
        }
      }
    }
    List<Model> lm = new ArrayList<Model>();

    for (AbstractClass abstractClass : existing) {
      EObject rootContainer2 = CommonServices.getRootContainer(abstractClass);
      if (rootContainer2 instanceof Model) {
        Model rootContainer = (Model) rootContainer2;
        lm.add(rootContainer);
      }
    }

    for (Model package1 : lm) {
      EList<Clazz> allClasses = package1.getAllClasses();
      all.addAll(allClasses);
    }

    return CollectionUtils.subtract(all, existing);
  }
Example #2
0
 public List<Clazz> getClazzWithoutAsptect(Aspect a) {
   List<Clazz> classWithAsptect = new ArrayList<Clazz>();
   List<Clazz> l = ((ClassPackage) CommonServices.getRootContainer(a)).getAllClasses();
   for (Clazz clazz : l) {
     for (Aspect ca : clazz.getAllAspects()) {
       if (ca.getName().equals(a.getName())) {
         classWithAsptect.add(clazz);
       }
     }
   }
   l.removeAll(classWithAsptect);
   return l;
 }