Example #1
0
 @Override
 protected void handleAttribute(Object resultObject, String name, String value)
     throws SAXException {
   BaseSModelDescriptor.ModelLoadResult result =
       (BaseSModelDescriptor.ModelLoadResult) resultObject;
   if ("modelUID".equals(name)) {
     return;
   }
   if ("version".equals(name)) {
     fieldmodel.getSModelHeader().setVersion(AttributeUtils.integerWithDefault(value, -1));
     return;
   }
   if ("doNotGenerate".equals(name)) {
     fieldmodel
         .getSModelHeader()
         .setDoNotGenerate(AttributeUtils.booleanWithDefault(value, false));
     return;
   }
   super.handleAttribute(resultObject, name, value);
 }
Example #2
0
    private void load(File file, Element root) {
      Macros macros = MacrosFactory.projectDescriptor();
      FileMPSProject.ProjectDescriptor result_dkknya_a1a1a = this;
      final String result_dkknya_a0a1a1a = file.getName();
      result_dkknya_a1a1a.setName(result_dkknya_a0a1a1a);

      if (root == null) {
        return;
      }

      List<Element> moduleList = ListSequence.fromList(new ArrayList<Element>());
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(
                              AttributeUtils.elementChildren(root, "projectSolutions"))
                          .first(),
                      "solutionPath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(
                              AttributeUtils.elementChildren(root, "projectLanguages"))
                          .first(),
                      "languagePath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(AttributeUtils.elementChildren(root, "projectDevkits"))
                          .first(),
                      "devkitPath")));
      ListSequence.fromList(moduleList)
          .addSequence(
              ListSequence.fromList(
                  AttributeUtils.elementChildren(
                      ListSequence.fromList(AttributeUtils.elementChildren(root, "projectModules"))
                          .first(),
                      "modulePath")));
      for (Element moduleElement : ListSequence.fromList(moduleList)) {
        Path modulePath = new Path();
        Path result_dkknya_a1a9a1a1a = modulePath;
        final String result_dkknya_a0a1a9a1a1a =
            macros.expandPath(moduleElement.getAttributeValue("path"), file);
        result_dkknya_a1a9a1a1a.setPath(result_dkknya_a0a1a9a1a1a);
        final String result_dkknya_a1a1a9a1a1a = moduleElement.getAttributeValue("folder");
        result_dkknya_a1a9a1a1a.setMPSFolder(result_dkknya_a1a1a9a1a1a);
        result_dkknya_a1a1a.addModule(modulePath);
      }

      for (Element e :
          ListSequence.fromList(
              AttributeUtils.elementChildren(
                  ListSequence.fromList(AttributeUtils.elementChildren(root, "genConfs")).first(),
                  "genConfModels"))) {
        ModelsTestConfiguration tc = new ModelsTestConfiguration();
        tc.setName(e.getAttributeValue("name"));
        for (Element me :
            ListSequence.fromList(
                AttributeUtils.elementChildren(
                    ListSequence.fromList(AttributeUtils.elementChildren(e, "models")).first(),
                    "model"))) {
          tc.addModel(SModelReference.fromString(me.getAttributeValue("modelRef")));
        }
        result_dkknya_a1a1a.getTestConfiturations().add(tc);
      }
      for (Element e :
          ListSequence.fromList(
              AttributeUtils.elementChildren(
                  ListSequence.fromList(AttributeUtils.elementChildren(root, "genConfs")).first(),
                  "genConfModule"))) {
        ModuleTestConfiguration tc = new ModuleTestConfiguration();
        tc.setName(e.getAttributeValue("name"));
        if (e.getAttributeValue("moduleRef") != null) {
          tc.setModuleRef(ModuleReference.fromString(e.getAttributeValue("moduleRef")));
          result_dkknya_a1a1a.getTestConfiturations().add(tc);
        }
      }
    }