Package: ModuleSpec

ModuleSpec

nameinstructionbranchcomplexitylinemethod
ModuleSpec()
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%
toString()
M: 104 C: 0
0%
M: 12 C: 0
0%
M: 7 C: 0
0%
M: 20 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2009, 2012 Obeo.
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: * Obeo - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.acceleo.model.mtl.impl.spec;
12:
13: import java.util.List;
14:
15: import org.eclipse.acceleo.model.mtl.Module;
16: import org.eclipse.acceleo.model.mtl.TypedModel;
17: import org.eclipse.acceleo.model.mtl.impl.ModuleImpl;
18:
19: /**
20: * Specializes the Module implementation.
21: *
22: * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
23: */
24: public class ModuleSpec extends ModuleImpl {
25:         /**
26:          * {@inheritDoc}
27:          *
28:          * @see org.eclipse.emf.ecore.impl.EPackageImpl#toString()
29:          */
30:         @Override
31:         public String toString() {
32:                 final List<Module> extended = getExtends();
33:                 final List<TypedModel> metamodels = getInput();
34:
35:                 final StringBuilder toString = new StringBuilder("module"); //$NON-NLS-1$
36:                 toString.append(' ');
37:                 toString.append(getName());
38:                 toString.append('(');
39:•                for (int i = 0; i < metamodels.size(); i++) {
40:                         toString.append(metamodels.get(i).toString());
41:•                        if (i + 1 < metamodels.size()) {
42:                                 toString.append(',').append(' ');
43:                         }
44:                 }
45:                 toString.append(')');
46:•                if (extended != null && extended.size() > 0) {
47:                         toString.append(' ');
48:                         toString.append("extends"); //$NON-NLS-1$
49:                         toString.append(' ');
50:•                        for (int i = 0; i < extended.size(); i++) {
51:                                 toString.append(extended.get(i).toString());
52:•                                if (i + 1 < extended.size()) {
53:                                         toString.append(',').append(' ');
54:                                 }
55:                         }
56:                 }
57:                 return toString.toString();
58:         }
59: }