Package: TemplateSpec

TemplateSpec

nameinstructionbranchcomplexitylinemethod
TemplateSpec()
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: 59 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 12 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.impl.TemplateImpl;
16: import org.eclipse.ocl.ecore.Variable;
17:
18: /**
19: * Specializes the template implementation.
20: *
21: * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
22: */
23: public class TemplateSpec extends TemplateImpl {
24:         /**
25:          * {@inheritDoc}
26:          *
27:          * @see org.eclipse.acceleo.model.mtl.impl.TemplateImpl#toString()
28:          */
29:         @Override
30:         public String toString() {
31:                 final List<Variable> params = getParameter();
32:
33:                 final StringBuilder toString = new StringBuilder(getName());
34:                 toString.append('(');
35:•                for (int i = 0; i < params.size(); i++) {
36:•                        if (params.get(i).getType() != null) {
37:                                 toString.append(params.get(i).getType().getName());
38:                         } else {
39:                                 toString.append(""); //$NON-NLS-1$
40:                         }
41:•                        if (i + 1 < params.size()) {
42:                                 toString.append(',');
43:                         }
44:                 }
45:                 toString.append(')');
46:
47:                 return toString.toString();
48:         }
49: }