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.kim.bo.options;
17  
18  import org.kuali.rice.core.api.util.ConcreteKeyValue;
19  import org.kuali.rice.core.api.util.KeyValue;
20  import org.kuali.rice.coreservice.framework.CoreFrameworkServiceLocator;
21  import org.kuali.rice.kim.api.KimConstants;
22  import org.kuali.rice.kim.bo.ui.PersonDocumentName;
23  import org.kuali.rice.krad.keyvalues.KeyValuesBase;
24  
25  import java.util.ArrayList;
26  import java.util.Collection;
27  import java.util.List;
28  
29  /**
30   * This is a description of what this class does - shyu don't forget to fill this in. 
31   * 
32   * @author Kuali Rice Team (rice.collab@kuali.org)
33   *
34   */
35  public class NamePrefixValuesFinder extends KeyValuesBase {
36  
37  	private static final String PARAM_BO_CLASSNAME = PersonDocumentName.class.getSimpleName();
38  	
39      /*
40       * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
41       */
42      @Override
43  	public List<KeyValue> getKeyValues() {
44  
45      	Collection<String> values = CoreFrameworkServiceLocator.getParameterService().getParameterValuesAsString(
46                  KimConstants.NAMESPACE_CODE, PARAM_BO_CLASSNAME, "PREFIXES"
47          );
48          List<KeyValue> labels = new ArrayList<KeyValue>();
49          labels.add(new ConcreteKeyValue("", ""));
50          for (String title : values) {
51              labels.add(new ConcreteKeyValue(title, title));
52              
53          }
54  
55          return labels;
56      }    
57  
58  }