View Javadoc

1   /*
2    * Copyright 2006-2011 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.framework.services.CoreFrameworkServiceLocator;
19  import org.kuali.rice.core.util.ConcreteKeyValue;
20  import org.kuali.rice.core.util.KeyValue;
21  import org.kuali.rice.kim.bo.ui.PersonDocumentName;
22  import org.kuali.rice.kim.util.KimConstants;
23  import org.kuali.rice.kns.lookup.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 NameSuffixValuesFinder 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, "SUFFIXES"
47          );
48          List<KeyValue> labels = new ArrayList<KeyValue>();
49          labels.add(new ConcreteKeyValue("", ""));
50          for (String suffix : values) {
51              labels.add(new ConcreteKeyValue(suffix, suffix));            
52          }
53  
54          return labels;
55      }
56  
57  
58  }