1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package org.apache.tapestry.engine; |
16 |
|
|
17 |
|
import java.util.List; |
18 |
|
|
19 |
|
import org.apache.hivemind.impl.MessageFormatter; |
20 |
|
import org.apache.tapestry.IComponent; |
21 |
|
import org.apache.tapestry.IPage; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
public final class EngineMessages |
28 |
|
{ |
29 |
2 |
private static final MessageFormatter _formatter = new MessageFormatter(EngineMessages.class); |
30 |
|
|
31 |
|
|
32 |
0 |
private EngineMessages() { } |
33 |
|
|
34 |
|
public static String serviceNoParameter(IEngineService service) |
35 |
|
{ |
36 |
2 |
return _formatter.format("service-no-parameter", service.getName()); |
37 |
|
} |
38 |
|
|
39 |
|
public static String wrongComponentType(IComponent component, Class expectedType) |
40 |
|
{ |
41 |
2 |
return _formatter.format("wrong-component-type", component.getExtendedId(), expectedType |
42 |
|
.getName()); |
43 |
|
} |
44 |
|
|
45 |
|
public static String requestStateSession(IComponent component) |
46 |
|
{ |
47 |
2 |
return _formatter.format("request-stale-session", component.getExtendedId()); |
48 |
|
} |
49 |
|
|
50 |
|
public static String pageNotCompatible(IPage page, Class expectedType) |
51 |
|
{ |
52 |
1 |
return _formatter.format("page-not-compatible", page.getPageName(), expectedType.getName()); |
53 |
|
} |
54 |
|
|
55 |
|
public static String noBrowserEvent() |
56 |
|
{ |
57 |
1 |
return _formatter.format("missing-browser-event", new Object[]{}); |
58 |
|
} |
59 |
|
|
60 |
|
static String exceptionDuringCleanup(Throwable cause) |
61 |
|
{ |
62 |
0 |
return _formatter.format("exception-during-cleanup", cause); |
63 |
|
} |
64 |
|
|
65 |
|
static String validateCycle(List pageNames) |
66 |
|
{ |
67 |
0 |
StringBuffer buffer = new StringBuffer(); |
68 |
0 |
int count = pageNames.size(); |
69 |
|
|
70 |
0 |
for (int i = 0; i < count; i++) |
71 |
|
{ |
72 |
0 |
if (i > 0) |
73 |
0 |
buffer.append("; "); |
74 |
|
|
75 |
0 |
buffer.append(pageNames.get(i)); |
76 |
|
} |
77 |
|
|
78 |
0 |
return _formatter.format("validate-cycle", buffer); |
79 |
|
} |
80 |
|
} |