KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > resourcebundle > ResourceMessage


1 package org.jahia.resourcebundle;
2
3 /**
4  * <p>Title: I18N Resource bundle message object</p>
5  * <p>Description: </p>
6  * <p>Copyright: Copyright (c) 2002</p>
7  * <p>Company: Jahia Ltd</p>
8  * @author Serge Huber
9  * @version 1.0
10  */

11
12 public class ResourceMessage {
13
14     private Object JavaDoc[] parameters;
15     private String JavaDoc resourceKey;
16
17     public ResourceMessage () {
18     }
19
20     public ResourceMessage (String JavaDoc resourceKey) {
21         this.resourceKey = resourceKey;
22         this.parameters = null;
23     }
24
25     public ResourceMessage (String JavaDoc resourceKey, Object JavaDoc[] parameters) {
26         this.resourceKey = resourceKey;
27         this.parameters = parameters;
28     }
29
30     public ResourceMessage (String JavaDoc resourceKey, Object JavaDoc parameter) {
31         this.resourceKey = resourceKey;
32         Object JavaDoc[] parameters = new Object JavaDoc[1];
33         parameters[0] = parameter;
34         this.parameters = parameters;
35     }
36
37     public ResourceMessage (String JavaDoc resourceKey, Object JavaDoc parameter1,
38                             Object JavaDoc parameter2) {
39         this.resourceKey = resourceKey;
40         Object JavaDoc[] parameters = new Object JavaDoc[2];
41         parameters[0] = parameter1;
42         parameters[1] = parameter2;
43         this.parameters = parameters;
44     }
45
46     public ResourceMessage (String JavaDoc resourceKey, Object JavaDoc parameter1,
47                             Object JavaDoc parameter2, Object JavaDoc parameter3) {
48         this.resourceKey = resourceKey;
49         Object JavaDoc[] parameters = new Object JavaDoc[3];
50         parameters[0] = parameter1;
51         parameters[1] = parameter2;
52         parameters[2] = parameter3;
53         this.parameters = parameters;
54     }
55
56     public ResourceMessage (String JavaDoc resourceKey, Object JavaDoc parameter1,
57                             Object JavaDoc parameter2, Object JavaDoc parameter3,
58                             Object JavaDoc parameter4) {
59         this.resourceKey = resourceKey;
60         Object JavaDoc[] parameters = new Object JavaDoc[4];
61         parameters[0] = parameter1;
62         parameters[1] = parameter2;
63         parameters[2] = parameter3;
64         parameters[3] = parameter4;
65         this.parameters = parameters;
66     }
67
68     public Object JavaDoc[] getParameters () {
69         return parameters;
70     }
71
72     public void setParameters (Object JavaDoc[] parameters) {
73         this.parameters = parameters;
74     }
75
76     public String JavaDoc getResourceKey () {
77         return resourceKey;
78     }
79
80     public void setResourceKey (String JavaDoc resourceKey) {
81         this.resourceKey = resourceKey;
82     }
83
84 }
Popular Tags