View Javadoc

1   package org.kuali.ole.editor.keyvalue;
2   
3   import org.kuali.ole.catalog.bo.OleLendingPolicy;
4   import org.kuali.rice.core.api.util.ConcreteKeyValue;
5   import org.kuali.rice.core.api.util.KeyValue;
6   import org.kuali.rice.krad.keyvalues.KeyValuesBase;
7   import org.kuali.rice.krad.service.KRADServiceLocator;
8   
9   import java.util.ArrayList;
10  import java.util.Collection;
11  import java.util.List;
12  
13  /**
14   * Created by IntelliJ IDEA.
15   * User: poornimap
16   * Date: 6/4/12
17   * Time: 8:05 PM
18   * To change this template use File | Settings | File Templates.
19   */
20  public class LendingPolicy extends KeyValuesBase {
21      /**
22       * This method returns the List of ConcreteKeyValue,
23       * ConcreteKeyValue has two arguments lendingPolicyCode and
24       * lendingPolicyName.
25       * @return   List<KeyValue>
26       */
27      @Override
28      public List<KeyValue> getKeyValues() {
29          List<KeyValue> options = new ArrayList<KeyValue>();
30          Collection<OleLendingPolicy> oleLendingPolicies = KRADServiceLocator.getBusinessObjectService().findAll(OleLendingPolicy.class);
31          options.add(new ConcreteKeyValue("", ""));
32          for (OleLendingPolicy type : oleLendingPolicies) {
33              options.add(new ConcreteKeyValue(type.getLendingPolicyCode(), type.getLendingPolicyName()));
34          }
35          return options;
36      }
37  }