View Javadoc
1   /**
2    * Copyright 2005-2016 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   * @deprecated Only used in KNS classes, use KRAD.
29   */
30  @Deprecated
31  public class WarningContainer extends MessageContainer {
32  
33  	public WarningContainer(MessageMap errorMap) {
34  		super(errorMap);
35  	}
36  	
37  	/**
38  	 * This overridden method ...
39  	 * 
40  	 * @see MessageContainer#getMessageCount()
41  	 */
42  	@Override
43  	public int getMessageCount() {
44  		return getMessageMap().getWarningCount();
45  	}
46  
47  	
48  	/**
49  	 * @see MessageContainer#getMessagePropertyNames()
50  	 */
51  	@Override
52  	protected Set<String> getMessagePropertyNames() {
53  		return getMessageMap().getAllPropertiesWithWarnings();
54  	}
55  
56  	/**
57  	 * @see MessageContainer#getMessagePropertyList()
58  	 */
59  	@Override
60  	public List<String> getMessagePropertyList() {
61  		return getMessageMap().getPropertiesWithWarnings();
62  	}
63  	
64  	/**
65  	 * @see MessageContainer#getMessagesForProperty(java.lang.String)
66  	 */
67  	@Override
68  	protected List getMessagesForProperty(String propertyName) {
69  		return getMessageMap().getWarningMessagesForProperty(propertyName);
70  	}
71  }