1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package org.apache.tapestry.parse; |
16 |
|
|
17 |
|
import org.apache.hivemind.HiveMind; |
18 |
|
import org.apache.hivemind.Location; |
19 |
|
import org.apache.hivemind.Resource; |
20 |
|
import org.apache.hivemind.impl.MessageFormatter; |
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
final class ParseMessages |
29 |
|
{ |
30 |
2 |
private static final MessageFormatter _formatter = new MessageFormatter(ParseMessages.class); |
31 |
|
|
32 |
|
|
33 |
0 |
private ParseMessages() { } |
34 |
|
|
35 |
|
static String commentNotEnded(int line) |
36 |
|
{ |
37 |
1 |
return _formatter.format("comment-not-ended", new Integer(line)); |
38 |
|
} |
39 |
|
|
40 |
|
static String unclosedUnknownTag(int line) |
41 |
|
{ |
42 |
0 |
return _formatter.format("unclosed-unknown-tag", new Integer(line)); |
43 |
|
} |
44 |
|
|
45 |
|
static String unclosedTag(String tagName, int line) |
46 |
|
{ |
47 |
1 |
return _formatter.format("unclosed-tag", tagName, new Integer(line)); |
48 |
|
} |
49 |
|
|
50 |
|
static String missingAttributeValue(String tagName, int line, String attributeName) |
51 |
|
{ |
52 |
1 |
return _formatter.format( |
53 |
|
"missing-attribute-value", |
54 |
|
tagName, |
55 |
|
new Integer(line), |
56 |
|
attributeName); |
57 |
|
} |
58 |
|
|
59 |
|
static String componentMayNotBeIgnored(String tagName, int line) |
60 |
|
{ |
61 |
3 |
return _formatter.format("component-may-not-be-ignored", tagName, new Integer(line)); |
62 |
|
} |
63 |
|
|
64 |
|
static String componentIdInvalid(String tagName, int line, String jwcid) |
65 |
|
{ |
66 |
0 |
return _formatter.format("component-id-invalid", tagName, new Integer(line), jwcid); |
67 |
|
} |
68 |
|
|
69 |
|
static String unknownComponentId(String tagName, int line, String jwcid) |
70 |
|
{ |
71 |
1 |
return _formatter.format("unknown-component-id", tagName, new Integer(line), jwcid); |
72 |
|
} |
73 |
|
|
74 |
|
static String nestedIgnore(String tagName, int line) |
75 |
|
{ |
76 |
1 |
return _formatter.format("nested-ignore", tagName, new Integer(line)); |
77 |
|
} |
78 |
|
|
79 |
|
static String contentBlockMayNotBeIgnored(String tagName, int line) |
80 |
|
{ |
81 |
1 |
return _formatter.format("content-block-may-not-be-ignored", tagName, new Integer(line)); |
82 |
|
} |
83 |
|
|
84 |
|
static String contentBlockMayNotBeEmpty(String tagName, int line) |
85 |
|
{ |
86 |
0 |
return _formatter.format("content-block-may-not-be-empty", tagName, new Integer(line)); |
87 |
|
} |
88 |
|
|
89 |
|
static String incompleteCloseTag(int line) |
90 |
|
{ |
91 |
1 |
return _formatter.format("incomplete-close-tag", new Integer(line)); |
92 |
|
} |
93 |
|
|
94 |
|
static String improperlyNestedCloseTag(String tagName, int closeLine, String startTagName, |
95 |
|
int startLine) |
96 |
|
{ |
97 |
1 |
return _formatter.format("improperly-nested-close-tag", new Object[] |
98 |
|
{ tagName, new Integer(closeLine), startTagName, new Integer(startLine) }); |
99 |
|
} |
100 |
|
|
101 |
|
static String unmatchedCloseTag(String tagName, int line) |
102 |
|
{ |
103 |
1 |
return _formatter.format("unmatched-close-tag", tagName, new Integer(line)); |
104 |
|
} |
105 |
|
|
106 |
|
static String failConvertBoolean(String value) |
107 |
|
{ |
108 |
0 |
return _formatter.format("fail-convert-boolean", value); |
109 |
|
} |
110 |
|
|
111 |
|
static String failConvertDouble(String value) |
112 |
|
{ |
113 |
0 |
return _formatter.format("fail-convert-double", value); |
114 |
|
} |
115 |
|
|
116 |
|
static String failConvertInt(String value) |
117 |
|
{ |
118 |
0 |
return _formatter.format("fail-convert-int", value); |
119 |
|
} |
120 |
|
|
121 |
|
static String failConvertLong(String value) |
122 |
|
{ |
123 |
0 |
return _formatter.format("fail-convert-long", value); |
124 |
|
} |
125 |
|
|
126 |
|
static String unableToCopy(String id) |
127 |
|
{ |
128 |
1 |
return _formatter.format("unable-to-copy", id); |
129 |
|
} |
130 |
|
|
131 |
|
static String bothTypeAndCopyOf(String id) |
132 |
|
{ |
133 |
1 |
return _formatter.format("both-type-and-copy-of", id); |
134 |
|
} |
135 |
|
|
136 |
|
static String missingTypeOrCopyOf(String id) |
137 |
|
{ |
138 |
1 |
return _formatter.format("missing-type-or-copy-of", id); |
139 |
|
} |
140 |
|
|
141 |
|
static String frameworkLibraryIdIsReserved(String id) |
142 |
|
{ |
143 |
1 |
return _formatter.format("framework-library-id-is-reserved", id); |
144 |
|
} |
145 |
|
|
146 |
|
static String incorrectDocumentType(String expected, String actual) |
147 |
|
{ |
148 |
1 |
return _formatter.format("incorrect-document-type", expected, actual); |
149 |
|
} |
150 |
|
|
151 |
|
static String noAttributeAndBody(String attributeName, String elementName) |
152 |
|
{ |
153 |
1 |
return _formatter.format("no-attribute-and-body", attributeName, elementName); |
154 |
|
} |
155 |
|
|
156 |
|
static String requiredExtendedAttribute(String elementName, String attributeName) |
157 |
|
{ |
158 |
1 |
return _formatter.format("required-extended-attribute", elementName, attributeName); |
159 |
|
} |
160 |
|
|
161 |
|
static String invalidAttribute(String key, String value) |
162 |
|
{ |
163 |
7 |
return _formatter.format(key, value); |
164 |
|
} |
165 |
|
|
166 |
|
static String missingResource(Resource resource) |
167 |
|
{ |
168 |
0 |
return _formatter.format("missing-resource", resource); |
169 |
|
} |
170 |
|
|
171 |
|
static String errorReadingResource(Resource resource, Throwable cause) |
172 |
|
{ |
173 |
17 |
return _formatter.format("error-reading-resource", resource, cause); |
174 |
|
} |
175 |
|
|
176 |
|
static String unknownPublicId(Resource resource, String publicId) |
177 |
|
{ |
178 |
1 |
return _formatter.format("unknown-public-id", resource, publicId); |
179 |
|
} |
180 |
|
|
181 |
|
static String serviceElementNotSupported() |
182 |
|
{ |
183 |
0 |
return _formatter.getMessage("service-element-not-supported"); |
184 |
|
} |
185 |
|
|
186 |
|
static String rangeError(TemplateToken token, int length) |
187 |
|
{ |
188 |
0 |
return _formatter.format("range-error", token, new Integer(length)); |
189 |
|
} |
190 |
|
|
191 |
|
public static String duplicateTagAttribute(String tagName, int line, String attributeName) |
192 |
|
{ |
193 |
2 |
return _formatter.format( |
194 |
|
"duplicate-tag-attribute", |
195 |
|
tagName, |
196 |
|
new Integer(line), |
197 |
|
attributeName); |
198 |
|
} |
199 |
|
|
200 |
|
public static Object listenerBindingUnsupported(Location location) |
201 |
|
{ |
202 |
1 |
return _formatter.format("listener-binding-unsupported", HiveMind |
203 |
|
.getLocationString(location)); |
204 |
|
} |
205 |
|
} |