1 /**
2 * Copyright 2005-2015 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.krad.uif.util;
17
18 import org.kuali.rice.core.api.util.AbstractKeyValue;
19 import org.kuali.rice.krad.uif.element.Message;
20
21 /**
22 * KeyMessage object for key-value pairs that contain rich content in the value portion. By translating this content
23 * to message, the content will be parsed and replaced appropriately for KeyValue controls.
24 *
25 * @author Kuali Rice Team (rice.collab@kuali.org)
26 */
27 public class KeyMessage extends AbstractKeyValue {
28 private Message message;
29
30 /**
31 * Constructor for KeyMessage
32 *
33 * @param key key
34 * @param value value
35 * @param message message with messageText set to value
36 */
37 public KeyMessage(String key, String value, Message message) {
38 this.key = key;
39 this.value = value;
40 this.message = message;
41 }
42
43 /**
44 * Set the key
45 *
46 * @param key
47 */
48 public void setKey(String key) {
49 this.key = key;
50 }
51
52 /**
53 * Set the value
54 *
55 * @param value
56 */
57 public void setValue(String value) {
58 this.value = value;
59 }
60
61 /**
62 * Get the message. The message will contain the translated/parsed value after its lifecycle executes.
63 *
64 * @return message with translated structure
65 */
66 public Message getMessage() {
67 return message;
68 }
69
70 /**
71 * Set the message. The message should have the rich message value as its messageText
72 *
73 * @param message
74 */
75 public void setMessage(Message message) {
76 this.message = message;
77 }
78
79
80 }