1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.test; |
16 |
| |
17 |
| import org.apache.hivemind.Location; |
18 |
| import org.apache.hivemind.impl.MessageFormatter; |
19 |
| import org.apache.hivemind.service.ClassFabUtils; |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| public class ScriptMessages |
35 |
| { |
36 |
| protected static MessageFormatter _formatter = new MessageFormatter(ScriptMessages.class, |
37 |
| "ScriptStrings"); |
38 |
| |
39 |
2
| public static String expectedSubstringMissing(String substring, Location location)
|
40 |
| { |
41 |
2
| return _formatter.format("expected-substring-missing", substring, location);
|
42 |
| } |
43 |
| |
44 |
2
| public static String expectedRegexpMissing(String regexp, Location location)
|
45 |
| { |
46 |
2
| return _formatter.format("expected-regexp-missing", regexp, location);
|
47 |
| } |
48 |
| |
49 |
1
| static String unexpectedAttributeInElement(String attributeName, String elementName)
|
50 |
| { |
51 |
1
| return _formatter.format("unexpected-attribute-in-element", attributeName, elementName);
|
52 |
| } |
53 |
| |
54 |
1
| static String missingRequiredAttribute(String attributeName, String elementName)
|
55 |
| { |
56 |
1
| return _formatter.format("missing-required-attribute", attributeName, elementName);
|
57 |
| } |
58 |
| |
59 |
0
| static String invalidIntAttribute(String attributeName, String elementName,
|
60 |
| Location location, String attributeValue) |
61 |
| { |
62 |
0
| return _formatter.format("invalid-int-attribute", new Object[]
|
63 |
| { attributeName, elementName, location, attributeValue }); |
64 |
| } |
65 |
| |
66 |
1
| public static String incorrectRegexpMatch(String expectedMatch, Location location,
|
67 |
| String actualMatch) |
68 |
| { |
69 |
1
| return _formatter.format("incorrect-regexp-match", expectedMatch, location, actualMatch);
|
70 |
| } |
71 |
| |
72 |
2
| public static String incorrectRegexpMatchCount(String pattern, Location location,
|
73 |
| int expectedCount, int actualCount) |
74 |
| { |
75 |
2
| return _formatter.format("incorrect-regexp-match-count", new Object[]
|
76 |
| { pattern, location, new Integer(expectedCount), new Integer(actualCount) }); |
77 |
| } |
78 |
| |
79 |
1
| static String wrongTypeForEnhancement(Class type)
|
80 |
| { |
81 |
1
| return _formatter
|
82 |
| .format("wrong-type-for-enhancement", ClassFabUtils.getJavaClassName(type)); |
83 |
| } |
84 |
| |
85 |
0
| static String unableToInstantiate(Class abstractClass, Throwable cause)
|
86 |
| { |
87 |
0
| return _formatter.format("unable-to-instantiate", abstractClass.getName(), cause);
|
88 |
| } |
89 |
| } |