Method: setInvalidNamesResult(InvalidNamesResult)

1: /*
2: * #%~
3: * VDM Code Generator
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.codegen.utils;
23:
24: import java.util.List;
25:
26: import org.overture.codegen.analysis.vdm.Renaming;
27: import org.overture.codegen.analysis.violations.InvalidNamesResult;
28:
29: public class GeneratedData
30: {
31:         private List<GeneratedModule> classes;
32:         private List<GeneratedModule> quoteValues;
33:         private InvalidNamesResult invalidNamesResult;
34:         private List<String> skippedClasses;
35:         private List<Renaming> allRenamings;
36:         private List<String> warnings;
37:
38:         public GeneratedData()
39:         {
40:         }
41:
42:         public GeneratedData(List<GeneratedModule> classes,
43:                         List<GeneratedModule> quoteValues,
44:                         InvalidNamesResult invalidNamesResult, List<String> skippedClasses)
45:         {
46:                 super();
47:                 this.classes = classes;
48:                 this.quoteValues = quoteValues;
49:                 this.invalidNamesResult = invalidNamesResult;
50:                 this.skippedClasses = skippedClasses;
51:         }
52:
53:         public boolean hasErrors()
54:         {
55:                 return hasErrors(classes) || hasErrors(quoteValues);
56:         }
57:
58:         public List<GeneratedModule> getClasses()
59:         {
60:                 return classes;
61:         }
62:
63:         public void setClasses(List<GeneratedModule> classes)
64:         {
65:                 this.classes = classes;
66:         }
67:
68:         public List<GeneratedModule> getQuoteValues()
69:         {
70:                 return quoteValues;
71:         }
72:
73:         public void setQuoteValues(List<GeneratedModule> quoteValues)
74:         {
75:                 this.quoteValues = quoteValues;
76:         }
77:
78:         public InvalidNamesResult getInvalidNamesResult()
79:         {
80:                 return invalidNamesResult;
81:         }
82:
83:         public void setInvalidNamesResult(InvalidNamesResult invalidNamesResult)
84:         {
85:                 this.invalidNamesResult = invalidNamesResult;
86:         }
87:
88:         public List<String> getSkippedClasses()
89:         {
90:                 return skippedClasses;
91:         }
92:
93:         public void setSkippedClasses(List<String> skippedClasses)
94:         {
95:                 this.skippedClasses = skippedClasses;
96:         }
97:
98:         public List<Renaming> getAllRenamings()
99:         {
100:                 return allRenamings;
101:         }
102:
103:         public void setAllRenamings(List<Renaming> allRenamings)
104:         {
105:                 this.allRenamings = allRenamings;
106:         }
107:
108:         public List<String> getWarnings()
109:         {
110:                 return warnings;
111:         }
112:
113:         public void setWarnings(List<String> warnings)
114:         {
115:                 this.warnings = warnings;
116:         }
117:
118:         private boolean hasErrors(List<GeneratedModule> modules)
119:         {
120:                 if (modules != null)
121:                 {
122:                         for (GeneratedModule clazz : modules)
123:                         {
124:                                 if (clazz.hasErrors())
125:                                 {
126:                                         return true;
127:                                 }
128:                         }
129:                 }
130:                 return false;
131:         }
132: }