001 /** 002 * Copyright 2005-2013 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.rice.krad.uif.util; 017 018 import org.kuali.rice.core.api.util.AbstractKeyValue; 019 import org.kuali.rice.krad.uif.element.Message; 020 021 /** 022 * KeyMessage object for key-value pairs that contain rich content in the value portion. By translating this content 023 * to message, the content will be parsed and replaced appropriately for KeyValue controls. 024 * 025 * @author Kuali Rice Team (rice.collab@kuali.org) 026 */ 027 public class KeyMessage extends AbstractKeyValue { 028 private Message message; 029 030 /** 031 * Constructor for KeyMessage 032 * 033 * @param key key 034 * @param value value 035 * @param message message with messageText set to value 036 */ 037 public KeyMessage(String key, String value, Message message) { 038 this.key = key; 039 this.value = value; 040 this.message = message; 041 } 042 043 /** 044 * Set the key 045 * 046 * @param key 047 */ 048 public void setKey(String key) { 049 this.key = key; 050 } 051 052 /** 053 * Set the value 054 * 055 * @param value 056 */ 057 public void setValue(String value) { 058 this.value = value; 059 } 060 061 /** 062 * Get the message. The message will contain the translated/parsed value after its lifecycle executes. 063 * 064 * @return message with translated structure 065 */ 066 public Message getMessage() { 067 return message; 068 } 069 070 /** 071 * Set the message. The message should have the rich message value as its messageText 072 * 073 * @param message 074 */ 075 public void setMessage(Message message) { 076 this.message = message; 077 } 078 079 080 }