1 /** 2 * Copyright 2005-2013 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.kns.util; 17 18 import org.kuali.rice.krad.util.MessageMap; 19 20 import java.util.List; 21 import java.util.Set; 22 23 /** 24 * An implementation of {@link MessageContainer} that makes warning messages accessible by the JSP layer 25 * 26 * @author Kuali Rice Team (rice.collab@kuali.org) 27 * 28 */ 29 public class WarningContainer extends MessageContainer { 30 31 public WarningContainer(MessageMap errorMap) { 32 super(errorMap); 33 } 34 35 /** 36 * This overridden method ... 37 * 38 * @see MessageContainer#getMessageCount() 39 */ 40 @Override 41 public int getMessageCount() { 42 return getMessageMap().getWarningCount(); 43 } 44 45 46 /** 47 * @see MessageContainer#getMessagePropertyNames() 48 */ 49 @Override 50 protected Set<String> getMessagePropertyNames() { 51 return getMessageMap().getAllPropertiesWithWarnings(); 52 } 53 54 /** 55 * @see MessageContainer#getMessagePropertyList() 56 */ 57 @Override 58 public List<String> getMessagePropertyList() { 59 return getMessageMap().getPropertiesWithWarnings(); 60 } 61 62 /** 63 * @see MessageContainer#getMessagesForProperty(java.lang.String) 64 */ 65 @Override 66 protected List getMessagesForProperty(String propertyName) { 67 return getMessageMap().getWarningMessagesForProperty(propertyName); 68 } 69 }