1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.valid; |
16 |
| |
17 |
| import java.util.Locale; |
18 |
| import java.util.ResourceBundle; |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| public final class ValidationStrings |
26 |
| { |
27 |
| public static final String REQUIRED_FIELD = "field-is-required"; |
28 |
| |
29 |
| public static final String INVALID_DATE = "invalid-date-format"; |
30 |
| public static final String INVALID_NUMBER = "invalid-numeric-format"; |
31 |
| public static final String INVALID_EMAIL = "invalid-email-format"; |
32 |
| |
33 |
| public static final String REGEX_MISMATCH = "regex-mismatch"; |
34 |
| |
35 |
| public static final String VALUE_TOO_SHORT = "field-too-short"; |
36 |
| public static final String VALUE_TOO_LONG = "field-too-long"; |
37 |
| |
38 |
| public static final String VALUE_TOO_SMALL = "number-too-small"; |
39 |
| public static final String VALUE_TOO_LARGE = "number-too-large"; |
40 |
| |
41 |
| public static final String DATE_TOO_EARLY = "date-too-early"; |
42 |
| public static final String DATE_TOO_LATE = "date-too-late"; |
43 |
| |
44 |
| public static final String INVALID_FIELD_EQUALITY = "invalid-field-equality"; |
45 |
| |
46 |
| private static final String RESOURCE_BUNDLE = ValidationStrings.class.getName(); |
47 |
| |
48 |
| |
49 |
| |
50 |
| |
51 |
| |
52 |
2
| public static String getMessagePattern(String key, Locale locale)
|
53 |
| { |
54 |
2
| return ResourceBundle.getBundle(RESOURCE_BUNDLE, locale).getString(key);
|
55 |
| } |
56 |
| |
57 |
0
| private ValidationStrings()
|
58 |
| { |
59 |
| |
60 |
| } |
61 |
| } |