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