1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package org.apache.tapestry.coerce; |
16 | |
|
17 | |
import org.apache.hivemind.impl.MessageFormatter; |
18 | |
import org.apache.hivemind.service.ClassFabUtils; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
final class CoerceMessages |
25 | |
{ |
26 | 0 | private static final MessageFormatter _formatter = new MessageFormatter(CoerceMessages.class); |
27 | |
|
28 | |
|
29 | 0 | private CoerceMessages() { } |
30 | |
|
31 | |
static String noConverter(Class desiredType) |
32 | |
{ |
33 | 0 | return _formatter.format("no-converter", ClassFabUtils.getJavaClassName(desiredType)); |
34 | |
} |
35 | |
|
36 | |
static String noConverter(Class fromType, Class desiredType) |
37 | |
{ |
38 | 0 | return _formatter.format("no-converter-from", ClassFabUtils.getJavaClassName(desiredType), |
39 | |
ClassFabUtils.getJavaClassName(fromType)); |
40 | |
} |
41 | |
|
42 | |
static String stringToNumberConversionError(String value, Class targetClass, Throwable cause) |
43 | |
{ |
44 | 0 | return _formatter.format( |
45 | |
"string-to-number-conversion-error", |
46 | |
value, |
47 | |
targetClass.getName(), |
48 | |
cause); |
49 | |
} |
50 | |
} |