コード例 #1
0
  private void copyActions(List<Action> actions) {
    if (actions.isEmpty()) return;

    ICSpecXMLFactory factory = ICSpecXMLFactory.eINSTANCE;
    IActionsType at = factory.createActionsType();
    xmlSpec.getActions().add(at);
    for (Action action : actions) {
      IAction xmlAction = factory.createAction();
      copyAction(action, xmlAction);
      if (action.isPublic()) at.getPublic().add(xmlAction);
      else at.getPrivate().add(xmlAction);
    }
  }
コード例 #2
0
  private void copyGroups(List<Group> groups) {
    if (groups.isEmpty()) return;

    ICSpecXMLFactory factory = ICSpecXMLFactory.eINSTANCE;
    IGroupsType gt = factory.createGroupsType();
    xmlSpec.getGroups().add(gt);
    for (Group group : groups) {
      IGroup xmlGroup = factory.createGroup();
      copyGroup(group, xmlGroup);
      if (group.isPublic()) gt.getPublic().add(xmlGroup);
      else gt.getPrivate().add(xmlGroup);
    }
  }
コード例 #3
0
  private void copyArtifacts(List<Artifact> artifacts) {
    if (artifacts.isEmpty()) return;

    ICSpecXMLFactory factory = ICSpecXMLFactory.eINSTANCE;
    IArtifactsType at = factory.createArtifactsType();
    xmlSpec.getArtifacts().add(at);
    for (Artifact artifact : artifacts) {
      IArtifact xmlArtifact = factory.createArtifact();
      copyArtifact(artifact, xmlArtifact);
      if (artifact.isPublic()) at.getPublic().add(xmlArtifact);
      else at.getPrivate().add(xmlArtifact);
    }
  }
コード例 #4
0
 private void copyPrerequisites(List<Prerequisite> preqs, List<IPrerequisite> xmlPreqs) {
   ICSpecXMLFactory cspecFactory = ICSpecXMLFactory.eINSTANCE;
   for (Prerequisite preq : preqs) {
     IPrerequisite xmlPreq = cspecFactory.createPrerequisite();
     xmlPreq.setAlias(preq.getAlias());
     xmlPreq.setName(preq.getAttribute());
     xmlPreq.setContributor(preq.isContributor());
     xmlPreq.setOptional(preq.isOptional());
     xmlPreq.setFilter(preq.getFilter());
     xmlPreq.setIncludePattern(preq.getIncludePattern());
     xmlPreq.setExcludePattern(preq.getExcludePattern());
     ComponentRequest c = preq.getComponent();
     if (c != null) {
       xmlPreq.setComponentType(c.getType());
       xmlPreq.setComponent(c.getId());
     }
     xmlPreqs.add(xmlPreq);
   }
 }