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.kim.bo.options; 017 018 import org.kuali.rice.core.api.util.ConcreteKeyValue; 019 import org.kuali.rice.core.api.util.KeyValue; 020 import org.kuali.rice.coreservice.framework.CoreFrameworkServiceLocator; 021 import org.kuali.rice.kim.api.KimConstants; 022 import org.kuali.rice.kim.bo.ui.PersonDocumentName; 023 import org.kuali.rice.krad.keyvalues.KeyValuesBase; 024 025 import java.util.ArrayList; 026 import java.util.Collection; 027 import java.util.List; 028 029 /** 030 * This is a description of what this class does - shyu don't forget to fill this in. 031 * 032 * @author Kuali Rice Team (rice.collab@kuali.org) 033 * 034 */ 035 public class NamePrefixValuesFinder extends KeyValuesBase { 036 037 private static final String PARAM_BO_CLASSNAME = PersonDocumentName.class.getSimpleName(); 038 039 /* 040 * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues() 041 */ 042 @Override 043 public List<KeyValue> getKeyValues() { 044 045 Collection<String> values = CoreFrameworkServiceLocator.getParameterService().getParameterValuesAsString( 046 KimConstants.NAMESPACE_CODE, PARAM_BO_CLASSNAME, "PREFIXES" 047 ); 048 List<KeyValue> labels = new ArrayList<KeyValue>(); 049 labels.add(new ConcreteKeyValue("", "")); 050 for (String title : values) { 051 labels.add(new ConcreteKeyValue(title, title)); 052 053 } 054 055 return labels; 056 } 057 058 }