1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.localization.internal.message; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.Collection; |
24 |
|
import java.util.List; |
25 |
|
import java.util.Locale; |
26 |
|
|
27 |
|
import org.xwiki.localization.TranslationBundle; |
28 |
|
import org.xwiki.localization.message.TranslationMessage; |
29 |
|
import org.xwiki.localization.message.TranslationMessageElement; |
30 |
|
import org.xwiki.rendering.block.Block; |
31 |
|
import org.xwiki.rendering.block.CompositeBlock; |
32 |
|
|
33 |
|
|
34 |
|
@link |
35 |
|
|
36 |
|
@version |
37 |
|
@since |
38 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
39 |
|
public class DefaultTranslationMessage implements TranslationMessage |
40 |
|
{ |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
private String rawSource; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
private List<TranslationMessageElement> elements; |
50 |
|
|
51 |
|
|
52 |
|
@param |
53 |
|
@param |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
55 |
0 |
public DefaultTranslationMessage(String rawSource, List<TranslationMessageElement> elements)... |
56 |
|
{ |
57 |
0 |
this.rawSource = rawSource; |
58 |
0 |
this.elements = new ArrayList<TranslationMessageElement>(elements); |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
61 |
0 |
@Override... |
62 |
|
public Block render(Locale locale, Collection<TranslationBundle> bundles, Object... parameters) |
63 |
|
{ |
64 |
0 |
Block block = new CompositeBlock(); |
65 |
|
|
66 |
0 |
for (TranslationMessageElement element : this.elements) { |
67 |
0 |
block.addChild(element.render(locale, bundles, parameters)); |
68 |
|
} |
69 |
|
|
70 |
0 |
return null; |
71 |
|
} |
72 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
73 |
0 |
@Override... |
74 |
|
public String getRawSource() |
75 |
|
{ |
76 |
0 |
return this.rawSource; |
77 |
|
} |
78 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
79 |
0 |
@Override... |
80 |
|
public String toString() |
81 |
|
{ |
82 |
0 |
return getRawSource(); |
83 |
|
} |
84 |
|
} |