001 /**
002 * Copyright 2005-2012 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.keyvalues;
017
018 import org.kuali.rice.core.api.util.KeyValue;
019
020 import java.util.List;
021 import java.util.Map;
022
023 /**
024 * Defines basic methods value finders
025 *
026 * @author Kuali Rice Team (rice.collab@kuali.org)
027 */
028 public interface KeyValuesFinder {
029
030 /**
031 * Builds a list of key values representations for valid value selections.
032 *
033 * @return List of KeyValue objects
034 */
035 public List<KeyValue> getKeyValues();
036
037 /**
038 * Builds a list of key values representations for valid value selections.
039 *
040 * @param includeActiveOnly whether to only include active values in the list
041 *
042 * @return List of KeyValue objects.
043 */
044 public List<KeyValue> getKeyValues(boolean includeActiveOnly);
045
046 /**
047 * Returns a map with the key as the key of the map and the label as the value. Used to render the label instead of the code in
048 * the jsp when the field is readonly.
049 *
050 * @return
051 */
052 public Map<String, String> getKeyLabelMap();
053
054 /**
055 * Returns the label for the associated key.
056 *
057 * @param key
058 * @return
059 */
060 public String getKeyLabel(String key);
061
062
063 /**
064 * Clears any internal cache that is being maintained by the value finder
065 */
066 public void clearInternalCache();
067
068 }