Пример #1
0
  /*
   * (non-Javadoc)
   * @see com.bluexml.side.util.generator.acceleo.AbstractAcceleoGenerator#
   * overHeadingModels(java.util.List)
   */
  @Override
  protected IFile overHeadingModels(List<IFile> models) throws Exception {
    File temporarySystemFile = this.getTemporarySystemFile();
    if (!temporarySystemFile.exists()) {
      temporarySystemFile.mkdirs();
    }
    IFolder iFile = IFileHelper.getIFolder(temporarySystemFile);
    IPath fullPath = iFile.getFullPath();
    // create overhead model resource
    // IPath p = models.get(0).getParent().getFullPath();

    IPath p = fullPath;
    p = p.append(OVER_HEAD_MODEL + "." + models.get(0).getFileExtension());
    IFile overheadedModel = IFileHelper.getIFile(p);

    // create overhead root element
    Model m = ClazzFactory.eINSTANCE.createModel();
    m.setName(OVER_HEAD_MODEL);
    MetaInfo createMetaInfo = CommonFactory.eINSTANCE.createMetaInfo();
    createMetaInfo.setKey("overHead");
    m.getMetainfo().add(createMetaInfo);
    for (IFile model : models) {
      EList<EObject> openModel = EResourceUtils.openModel(model);
      Model eObject = (Model) openModel.get(0);
      m.getPackageSet().add(eObject);
    }
    // save overhead model
    EResourceUtils.saveModel(overheadedModel, m);
    return overheadedModel;
  }
Пример #2
0
 public List<Attribute> getSearchableAttibutes(AbstractClass c) {
   List<Attribute> l = new ArrayList<Attribute>();
   EList<Attribute> allAttributes = null;
   if (c instanceof Clazz) {
     Clazz cz = (Clazz) c;
     allAttributes = cz.getAllAttributes();
   } else {
     allAttributes = c.getAttributes();
   }
   for (Attribute att : allAttributes) {
     for (MetaInfo mi : att.getMetainfo()) {
       if (mi.getKey().equalsIgnoreCase("propertySearched")
           && mi.getValue().equalsIgnoreCase("true")) {
         l.add(att);
       }
     }
   }
   return l;
 }