| 1 | package de.uka.ipd.sdq.cip.configuration; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | import java.util.Collection; |
| 5 | import java.util.List; |
| 6 | import java.util.Map; |
| 7 | |
| 8 | import de.uka.ipd.sdq.cip.ConstantsContainer; |
| 9 | |
| 10 | public class CompletionConfiguration { |
| 11 | protected List<Transformation> transformations; |
| 12 | protected String inputPartitionName; |
| 13 | protected String projectID; |
| 14 | protected boolean isDebug; |
| 15 | |
| 16 | @SuppressWarnings("unchecked") |
| 17 | public CompletionConfiguration(Map<String, Object> configuration) { |
| 18 | try { |
| 19 | isDebug = (Boolean) configuration.get(ConstantsContainer.COMPLETION_QVT_VERBOSE_LOGGING); |
| 20 | Collection<String> transformationStrings = (Collection<String>) configuration.get(ConstantsContainer.COMPLETION_CONFIG); |
| 21 | transformations = new ArrayList<Transformation>(); |
| 22 | for(String configString:transformationStrings) |
| 23 | { |
| 24 | Transformation transformation = Transformation.fromDataString(configString); |
| 25 | if(transformation.isEnabled()) |
| 26 | transformations.add(transformation); |
| 27 | } |
| 28 | } catch (Exception e) { |
| 29 | //throw new RuntimeException("Setting up properties failed, please check launch config (check all tabs).", e); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | public List<Transformation> getTransformations() { |
| 34 | return transformations; |
| 35 | } |
| 36 | |
| 37 | public String getInputPartitionName(){ |
| 38 | return inputPartitionName; |
| 39 | } |
| 40 | |
| 41 | public void setInputPartitionName( |
| 42 | String inputPartitionName) { |
| 43 | this.inputPartitionName = inputPartitionName; |
| 44 | |
| 45 | } |
| 46 | |
| 47 | public boolean getDebug() { |
| 48 | return isDebug; |
| 49 | } |
| 50 | |
| 51 | public String getProjectID() { |
| 52 | return projectID; |
| 53 | } |
| 54 | |
| 55 | public void setProjectID(String projectID) { |
| 56 | this.projectID = projectID; |
| 57 | } |
| 58 | } |