Skip to content

Package: ModelValidator

ModelValidator

nameinstructionbranchcomplexitylinemethod
ModelValidator()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getEPackage()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getResourceLocator()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
validate(int, Object, DiagnosticChain, Map)
M: 37 C: 16
30%
M: 6 C: 2
25%
M: 6 C: 2
25%
M: 7 C: 3
30%
M: 0 C: 1
100%
validateDomainIntermediate(DomainIntermediate, DiagnosticChain, Map)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
validateDomainRoot(DomainRoot, DiagnosticChain, Map)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
validateDynamicContainmentItem(DynamicContainmentItem, DiagnosticChain, Map)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
validateDynamicContainmentTree(DynamicContainmentTree, DiagnosticChain, Map)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
validateDynamicContainmentTreeDomainModelReference(DynamicContainmentTreeDomainModelReference, DiagnosticChain, Map)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
validateTestElement(TestElement, DiagnosticChain, Map)
M: 18 C: 94
84%
M: 25 C: 9
26%
M: 17 C: 1
6%
M: 1 C: 19
95%
M: 0 C: 1
100%
validateTestElementContainer(TestElementContainer, DiagnosticChain, Map)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
validateTestElement_validate(TestElement, DiagnosticChain, Map)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Edgar Mueller - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.dynamictree.model.util;
15:
16: import java.util.Map;
17:
18: import org.eclipse.emf.common.util.DiagnosticChain;
19: import org.eclipse.emf.common.util.ResourceLocator;
20: import org.eclipse.emf.ecore.EPackage;
21: import org.eclipse.emf.ecore.util.EObjectValidator;
22: import org.eclipse.emf.ecp.view.dynamictree.model.DomainIntermediate;
23: import org.eclipse.emf.ecp.view.dynamictree.model.DomainRoot;
24: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentItem;
25: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentTree;
26: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentTreeDomainModelReference;
27: import org.eclipse.emf.ecp.view.dynamictree.model.ModelPackage;
28: import org.eclipse.emf.ecp.view.dynamictree.model.TestElement;
29: import org.eclipse.emf.ecp.view.dynamictree.model.TestElementContainer;
30:
31: /**
32: * <!-- begin-user-doc -->
33: * The <b>Validator</b> for the model.
34: * <!-- end-user-doc -->
35: *
36: * @see org.eclipse.emf.ecp.view.dynamictree.model.ModelPackage
37: * @generated
38: */
39: public class ModelValidator extends EObjectValidator {
40:         /**
41:          * The cached model package
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @generated
46:          */
47:         public static final ModelValidator INSTANCE = new ModelValidator();
48:
49:         /**
50:          * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic
51:          * {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @see org.eclipse.emf.common.util.Diagnostic#getSource()
56:          * @see org.eclipse.emf.common.util.Diagnostic#getCode()
57:          * @generated
58:          */
59:         public static final String DIAGNOSTIC_SOURCE = "org.eclipse.emf.ecp.view.dynamictree.model";
60:
61:         /**
62:          * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Validate' of 'Test Element'.
63:          * <!-- begin-user-doc -->
64:          * <!-- end-user-doc -->
65:          *
66:          * @generated
67:          */
68:         public static final int TEST_ELEMENT__VALIDATE = 1;
69:
70:         /**
71:          * A constant with a fixed name that can be used as the base value for additional hand written constants.
72:          * <!-- begin-user-doc -->
73:          * <!-- end-user-doc -->
74:          *
75:          * @generated
76:          */
77:         private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 1;
78:
79:         /**
80:          * A constant with a fixed name that can be used as the base value for additional hand written constants in a
81:          * derived class.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
88:
89:         /**
90:          * Creates an instance of the switch.
91:          * <!-- begin-user-doc -->
92:          * <!-- end-user-doc -->
93:          *
94:          * @generated
95:          */
96:         public ModelValidator() {
97:                 super();
98:         }
99:
100:         /**
101:          * Returns the package of this validator switch.
102:          * <!-- begin-user-doc -->
103:          * <!-- end-user-doc -->
104:          *
105:          * @generated
106:          */
107:         @Override
108:         protected EPackage getEPackage() {
109:                 return ModelPackage.eINSTANCE;
110:         }
111:
112:         /**
113:          * Calls <code>validateXXX</code> for the corresponding classifier of the model.
114:          * <!-- begin-user-doc -->
115:          * <!-- end-user-doc -->
116:          *
117:          * @generated
118:          */
119:         @Override
120:         protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics,
121:                 Map<Object, Object> context) {
122:•                switch (classifierID) {
123:                 case ModelPackage.DYNAMIC_CONTAINMENT_TREE:
124:                         return validateDynamicContainmentTree((DynamicContainmentTree) value, diagnostics, context);
125:                 case ModelPackage.DYNAMIC_CONTAINMENT_ITEM:
126:                         return validateDynamicContainmentItem((DynamicContainmentItem) value, diagnostics, context);
127:                 case ModelPackage.TEST_ELEMENT:
128:                         return validateTestElement((TestElement) value, diagnostics, context);
129:                 case ModelPackage.DOMAIN_ROOT:
130:                         return validateDomainRoot((DomainRoot) value, diagnostics, context);
131:                 case ModelPackage.DOMAIN_INTERMEDIATE:
132:                         return validateDomainIntermediate((DomainIntermediate) value, diagnostics, context);
133:                 case ModelPackage.TEST_ELEMENT_CONTAINER:
134:                         return validateTestElementContainer((TestElementContainer) value, diagnostics, context);
135:                 case ModelPackage.DYNAMIC_CONTAINMENT_TREE_DOMAIN_MODEL_REFERENCE:
136:                         return validateDynamicContainmentTreeDomainModelReference(
137:                                 (DynamicContainmentTreeDomainModelReference) value, diagnostics, context);
138:                 default:
139:                         return true;
140:                 }
141:         }
142:
143:         /**
144:          * <!-- begin-user-doc -->
145:          * <!-- end-user-doc -->
146:          *
147:          * @generated
148:          */
149:         public boolean validateDynamicContainmentTree(DynamicContainmentTree dynamicContainmentTree,
150:                 DiagnosticChain diagnostics, Map<Object, Object> context) {
151:                 return validate_EveryDefaultConstraint(dynamicContainmentTree, diagnostics, context);
152:         }
153:
154:         /**
155:          * <!-- begin-user-doc -->
156:          * <!-- end-user-doc -->
157:          *
158:          * @generated
159:          */
160:         public boolean validateDynamicContainmentItem(DynamicContainmentItem dynamicContainmentItem,
161:                 DiagnosticChain diagnostics, Map<Object, Object> context) {
162:                 return validate_EveryDefaultConstraint(dynamicContainmentItem, diagnostics, context);
163:         }
164:
165:         /**
166:          * <!-- begin-user-doc -->
167:          * <!-- end-user-doc -->
168:          *
169:          * @generated
170:          */
171:         public boolean validateTestElement(TestElement testElement, DiagnosticChain diagnostics,
172:                 Map<Object, Object> context) {
173:•                if (!validate_NoCircularContainment(testElement, diagnostics, context)) {
174:                         return false;
175:                 }
176:                 boolean result = validate_EveryMultiplicityConforms(testElement, diagnostics, context);
177:•                if (result || diagnostics != null) {
178:                         result &= validate_EveryDataValueConforms(testElement, diagnostics, context);
179:                 }
180:•                if (result || diagnostics != null) {
181:                         result &= validate_EveryReferenceIsContained(testElement, diagnostics, context);
182:                 }
183:•                if (result || diagnostics != null) {
184:                         result &= validate_EveryBidirectionalReferenceIsPaired(testElement, diagnostics, context);
185:                 }
186:•                if (result || diagnostics != null) {
187:                         result &= validate_EveryProxyResolves(testElement, diagnostics, context);
188:                 }
189:•                if (result || diagnostics != null) {
190:                         result &= validate_UniqueID(testElement, diagnostics, context);
191:                 }
192:•                if (result || diagnostics != null) {
193:                         result &= validate_EveryKeyUnique(testElement, diagnostics, context);
194:                 }
195:•                if (result || diagnostics != null) {
196:                         result &= validate_EveryMapEntryUnique(testElement, diagnostics, context);
197:                 }
198:•                if (result || diagnostics != null) {
199:                         result &= validateTestElement_validate(testElement, diagnostics, context);
200:                 }
201:                 return result;
202:         }
203:
204:         /**
205:          * Validates the validate constraint of '<em>Test Element</em>'.
206:          * <!-- begin-user-doc -->
207:          * <!-- end-user-doc -->
208:          *
209:          * @generated
210:          */
211:         public boolean validateTestElement_validate(TestElement testElement, DiagnosticChain diagnostics,
212:                 Map<Object, Object> context) {
213:                 return testElement.validate(diagnostics, context);
214:         }
215:
216:         /**
217:          * <!-- begin-user-doc -->
218:          * <!-- end-user-doc -->
219:          *
220:          * @generated
221:          */
222:         public boolean validateDomainRoot(DomainRoot domainRoot, DiagnosticChain diagnostics, Map<Object, Object> context) {
223:                 return validate_EveryDefaultConstraint(domainRoot, diagnostics, context);
224:         }
225:
226:         /**
227:          * <!-- begin-user-doc -->
228:          * <!-- end-user-doc -->
229:          *
230:          * @generated
231:          */
232:         public boolean validateDomainIntermediate(DomainIntermediate domainIntermediate, DiagnosticChain diagnostics,
233:                 Map<Object, Object> context) {
234:                 return validate_EveryDefaultConstraint(domainIntermediate, diagnostics, context);
235:         }
236:
237:         /**
238:          * <!-- begin-user-doc -->
239:          * <!-- end-user-doc -->
240:          *
241:          * @generated
242:          */
243:         public boolean validateTestElementContainer(TestElementContainer testElementContainer, DiagnosticChain diagnostics,
244:                 Map<Object, Object> context) {
245:                 return validate_EveryDefaultConstraint(testElementContainer, diagnostics, context);
246:         }
247:
248:         /**
249:          * <!-- begin-user-doc -->
250:          * <!-- end-user-doc -->
251:          *
252:          * @generated
253:          */
254:         public boolean validateDynamicContainmentTreeDomainModelReference(
255:                 DynamicContainmentTreeDomainModelReference dynamicContainmentTreeDomainModelReference,
256:                 DiagnosticChain diagnostics, Map<Object, Object> context) {
257:                 return validate_EveryDefaultConstraint(dynamicContainmentTreeDomainModelReference, diagnostics, context);
258:         }
259:
260:         /**
261:          * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
262:          * <!-- begin-user-doc -->
263:          * <!-- end-user-doc -->
264:          *
265:          * @generated
266:          */
267:         @Override
268:         public ResourceLocator getResourceLocator() {
269:                 // TODO
270:                 // Specialize this to return a resource locator for messages specific to this validator.
271:                 // Ensure that you remove @generated or mark it @generated NOT
272:                 return super.getResourceLocator();
273:         }
274:
275: } // ModelValidator