View Javadoc

1   /*******************************************************************************
2    * Copyright (c) 2009 Ordina and committers to Mod4j
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *     Ordina - initial implementation
10   *******************************************************************************/
11  package org.mod4j.dslcommon.openarchitectureware;
12  
13  import java.util.ArrayList;
14  import java.util.List;
15  
16  /**
17   * Keeps all information regarding extension points from other plugins
18   * 
19   * @author jwa11799
20   * 
21   */
22  public class DslExtension {
23  
24      private String dslContributor = null;
25  
26      private String dslName = null;
27  
28      private String dslMetamodelPackage = null;
29  
30      private String dslFileExtension = null;
31  
32      private String dsl2crossxWorkflow = null;
33  
34      private String dslXtendModule = null;
35  
36      private String dslCodegenWorkflow = null;
37  
38      private String dslCodegenProperties = null;
39  
40      /**
41       * @param contributor
42       * @param name
43       * @param metamodelPackage
44       * @param fileExtension
45       * @param crossxWorkflow
46       * @param codegenWorkflow
47       * @param codegenProperties
48       */
49      public DslExtension(String contributor, String name, String metamodelPackage, String fileExtension,
50              String crossxWorkflow, String codegenWorkflow, String codegenProperties) {
51          dslContributor = contributor;
52          dslName = name;
53          dslMetamodelPackage = metamodelPackage;
54          dslFileExtension = fileExtension;
55          dsl2crossxWorkflow = crossxWorkflow;
56          dslCodegenWorkflow = codegenWorkflow;
57          dslCodegenProperties = codegenProperties;
58      }
59  
60      /**
61       * The name of the plugin / bundle that contributes to this extension
62       */
63      public String getDslContributor() {
64          return dslContributor;
65      }
66  
67      public String getDslName() {
68          return dslName;
69      }
70  
71      public String getDslMetamodelPackage() {
72          return dslMetamodelPackage;
73      }
74  
75      public String getDslFileExtension() {
76          return dslFileExtension;
77      }
78  
79      public String getDsl2crossxWorkflow() {
80          return dsl2crossxWorkflow;
81      }
82  
83      public String getDslCodegenWorkflow() {
84          return dslCodegenWorkflow;
85      }
86  
87      public String getDslCodegenProperties() {
88          return dslCodegenProperties;
89      }
90  
91      public static List<DslExtension> getExtensions() {
92          List<DslExtension> result = new ArrayList<DslExtension>();
93  
94          return result;
95      }
96  
97      public boolean validate() {
98          if (getDslName() == null)
99              return false;
100         if (getDslName().length() == 0)
101             return false;
102         // if (!getDsl2crossxWorkflow().endsWith(".oaw"))
103         // return false;
104         if (getDslContributor() == null)
105             return false;
106         if (getDslFileExtension() == null)
107             return false;
108         if (getDslMetamodelPackage() == null)
109             return false;
110 
111         return true;
112     }
113 
114 }