01: package org.vraptor.i18n;
02:
03: /**
04: * A fixed validation message.
05: *
06: * @author Guilherme Silveira
07: * @author Nico Steppat
08: * @since 2.1
09: */
10: public class FixedMessage implements ValidationMessage {
11:
12: private final String category, message;
13: private String path;
14:
15: /**
16: * Should not be used.
17: * Use FixedMessage(String path, String message, String category) instead.
18: *
19: * @param category
20: * @param message
21: */
22: @Deprecated
23: public FixedMessage(String category, String message) {
24: super ();
25: this .category = category;
26: this .message = message;
27: this .path = category;
28: }
29:
30: /**
31: *
32: * Creates a fixed message, which is already localized.
33: *
34: * @param path - complete attribute path in object hierachy
35: * @param message - the message, already localized, no fmt key here
36: * @param category - optional category
37: */
38: public FixedMessage(String path, String message, String category) {
39: this .path = path;
40: this .message = message;
41: this .category = category;
42: }
43:
44: public String getCategory() {
45: return category;
46: }
47:
48: public boolean isAlreadyLocalized() {
49: return true;
50: }
51:
52: public String getKey() {
53: return message;
54: }
55:
56: public String getPath() {
57: return path;
58: }
59:
60: public void setPath(String path) {
61: this.path = path;
62: }
63:
64: }
|