View Javadoc
1   /**
2    * Copyright 2005-2014 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.keyvalues;
17  
18  import java.util.List;
19  import java.util.Map;
20  
21  import org.kuali.rice.core.api.util.KeyValue;
22  
23  /**
24   * Defines basic methods value finders
25   *
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public interface KeyValuesFinder {
29  
30      /**
31       * Builds a list of key values representations for valid value selections.
32       *
33       * @return List of KeyValue objects
34       */
35      public List<KeyValue> getKeyValues();
36  
37      /**
38       * Builds a list of key values representations for valid value selections.
39       *
40       * @param includeActiveOnly whether to only include active values in the list
41       *
42       * @return List of KeyValue objects.
43       */
44      public List<KeyValue> getKeyValues(boolean includeActiveOnly);
45  
46      /**
47       * 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
48       * the jsp when the field is readonly.
49       *
50       * @return
51       */
52      public Map<String, String> getKeyLabelMap();
53  
54      /**
55       * Returns the label for the associated key.
56       *
57       * @param key
58       * @return
59       */
60      public String getKeyLabel(String key);
61  
62  
63      /**
64       * Clears any internal cache that is being maintained by the value finder
65       */
66      public void clearInternalCache();
67  
68  }