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