Package: EmfParsleyProjectFilesGeneratorUtil

EmfParsleyProjectFilesGeneratorUtil

nameinstructionbranchcomplexitylinemethod
EmfParsleyProjectFilesGeneratorUtil()
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%
buildClassNameFromProject(String)
M: 0 C: 17
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
buildFQNFromProject(String)
M: 2 C: 35
95%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 0 C: 8
100%
M: 0 C: 1
100%
getPackageFromProject(String)
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%
stripPackageFromProject(String)
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2015 RCP Vision (http://www.rcp-vision.com) and others.
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: * Lorenzo Bettini - initial API and implementation
10: */
11: package org.eclipse.emf.parsley.generator.common;
12:
13: import org.eclipse.xtext.xbase.lib.StringExtensions;
14:
15: /**
16: * @author Lorenzo Bettini - initial API and implementation
17: */
18: @SuppressWarnings("all")
19: public class EmfParsleyProjectFilesGeneratorUtil {
20: protected EmfParsleyProjectFilesGeneratorUtil() {
21: }
22:
23: public static String buildClassNameFromProject(final String projectName) {
24: String prefixName = projectName;
25: final int dotIndex = projectName.lastIndexOf(".");
26:• if ((dotIndex > 0)) {
27: prefixName = projectName.substring((dotIndex + 1));
28: }
29: return StringExtensions.toFirstUpper(prefixName);
30: }
31:
32: public static String buildFQNFromProject(final String projectName) {
33: String packageName = EmfParsleyProjectFilesGeneratorUtil.getPackageFromProject(projectName);
34: boolean _isEmpty = packageName.isEmpty();
35:• boolean _not = (!_isEmpty);
36:• if (_not) {
37: String _packageName = packageName;
38: packageName = (_packageName + ".");
39: }
40: String _buildClassNameFromProject = EmfParsleyProjectFilesGeneratorUtil.buildClassNameFromProject(projectName);
41: return (packageName + _buildClassNameFromProject);
42: }
43:
44: public static String stripPackageFromProject(final String projectName) {
45: final int dotIndex = projectName.lastIndexOf(".");
46:• if ((dotIndex > 0)) {
47: return projectName.substring((dotIndex + 1));
48: }
49: return projectName;
50: }
51:
52: public static String getPackageFromProject(final String projectName) {
53: return projectName;
54: }
55: }