1 |
|
package org.apache.torque.mojo.morph; |
2 |
|
|
3 |
|
import org.apache.commons.lang.StringUtils; |
4 |
|
import org.apache.commons.logging.Log; |
5 |
|
import org.apache.commons.logging.LogFactory; |
6 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 6 |
Complexity Density: 0.55 |
|
7 |
|
public class VersionTableMorpher extends Morpher { |
8 |
|
private static final Log log = LogFactory.getLog(VersionTableMorpher.class); |
9 |
|
|
10 |
|
String projectVersion; |
11 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
12 |
0
|
public VersionTableMorpher() {... |
13 |
0
|
this(null, null); |
14 |
|
} |
15 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
16 |
0
|
public VersionTableMorpher(MorphRequest morphRequest, String artifactId) {... |
17 |
0
|
super(morphRequest, artifactId); |
18 |
|
} |
19 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
20 |
0
|
protected String getMorphedContents(String contents) {... |
21 |
0
|
log.debug("contents=" + contents); |
22 |
0
|
String oldVersion = StringUtils.substringBetween(contents, "VERSION=\"", "\""); |
23 |
0
|
String searchString = "VERSION=\"" + oldVersion + "\""; |
24 |
0
|
String replacement = "VERSION=\"" + getProjectVersion() + "\""; |
25 |
0
|
String s = StringUtils.replace(contents, searchString, replacement); |
26 |
0
|
return s; |
27 |
|
} |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
32 |
0
|
protected boolean isMorphNeeded(String contents) {... |
33 |
0
|
return true; |
34 |
|
} |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
36 |
0
|
public String getProjectVersion() {... |
37 |
0
|
return projectVersion; |
38 |
|
} |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
40 |
0
|
public void setProjectVersion(String projectVersion) {... |
41 |
0
|
this.projectVersion = projectVersion; |
42 |
|
} |
43 |
|
|
44 |
|
} |