1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.internal; |
21 |
|
|
22 |
|
import java.io.IOException; |
23 |
|
import java.io.InputStream; |
24 |
|
import java.io.Reader; |
25 |
|
|
26 |
|
import org.apache.commons.lang3.StringUtils; |
27 |
|
import org.xwiki.configuration.ConfigurationSource; |
28 |
|
|
29 |
|
import com.xpn.xwiki.XWikiConfig; |
30 |
|
|
31 |
|
|
32 |
|
@link@link |
33 |
|
|
34 |
|
@version |
35 |
|
|
|
|
| 32.3% |
Uncovered Elements: 21 (31) |
Complexity: 12 |
Complexity Density: 0.86 |
|
36 |
|
public class XWikiConfigDelegate extends XWikiConfig |
37 |
|
{ |
38 |
|
private ConfigurationSource source; |
39 |
|
|
40 |
|
|
41 |
|
@param@link |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
43 |
17272 |
public XWikiConfigDelegate(ConfigurationSource source)... |
44 |
|
{ |
45 |
17272 |
this.source = source; |
46 |
|
|
47 |
17271 |
if (this.source instanceof XWikiCfgConfigurationSource) { |
48 |
17203 |
this.defaults = ((XWikiCfgConfigurationSource) this.source).getProperties(); |
49 |
|
} |
50 |
|
} |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
101 |
@Override... |
53 |
|
public String getProperty(String key) |
54 |
|
{ |
55 |
101 |
return StringUtils.trim(this.source.getProperty(key, String.class)); |
56 |
|
} |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
17233 |
@Override... |
59 |
|
public String getProperty(String key, String defaultValue) |
60 |
|
{ |
61 |
17233 |
return StringUtils.trim(this.source.getProperty(key, defaultValue)); |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
64 |
0 |
@Override... |
65 |
|
public synchronized Object put(Object key, Object value) |
66 |
|
{ |
67 |
0 |
if (this.defaults != null) { |
68 |
0 |
return this.defaults.put(key, value); |
69 |
|
} |
70 |
|
|
71 |
0 |
return null; |
72 |
|
} |
73 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
74 |
0 |
@Override... |
75 |
|
public synchronized void load(InputStream inStream) throws IOException |
76 |
|
{ |
77 |
0 |
if (this.defaults != null) { |
78 |
0 |
this.defaults.load(inStream); |
79 |
|
} |
80 |
|
} |
81 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
82 |
0 |
@Override... |
83 |
|
public synchronized void load(Reader reader) throws IOException |
84 |
|
{ |
85 |
0 |
if (this.defaults != null) { |
86 |
0 |
this.defaults.load(reader); |
87 |
|
} |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
90 |
0 |
@Override... |
91 |
|
public synchronized void loadFromXML(InputStream in) throws IOException |
92 |
|
{ |
93 |
0 |
if (this.defaults != null) { |
94 |
0 |
this.defaults.loadFromXML(in); |
95 |
|
} |
96 |
|
} |
97 |
|
} |