View Javadoc
1   package org.kuali.ole.describe.keyvalue;
2   
3   
4   import org.kuali.ole.describe.bo.OleAccessMethod;
5   import org.kuali.rice.core.api.util.ConcreteKeyValue;
6   import org.kuali.rice.core.api.util.KeyValue;
7   import org.kuali.rice.krad.keyvalues.KeyValuesBase;
8   import org.kuali.rice.krad.service.KRADServiceLocator;
9   
10  import java.util.ArrayList;
11  import java.util.Collection;
12  import java.util.List;
13  
14  /**
15   * AdditionalAccessMethodInformation used to render the values for AccessMethod dropdown control.
16   */
17  public class AdditionalAccessMethodInformation extends KeyValuesBase {
18      /**
19       * This method returns the List of  ConcreteKeyValue,
20       * ConcreteKeyValue has two arguments accessMethodCode  and
21       * accessMethodName.
22       *
23       * @return List<KeyValue>
24       */
25      @Override
26      public List<KeyValue> getKeyValues() {
27          List<KeyValue> options = new ArrayList<KeyValue>();
28          Collection<OleAccessMethod> oleAccessMethods =
29                  KRADServiceLocator.getBusinessObjectService().findAll(OleAccessMethod.class);
30          options.add(new ConcreteKeyValue("", ""));
31          for (OleAccessMethod type : oleAccessMethods) {
32              options.add(new ConcreteKeyValue(type.getAccessMethodCode(), type.getAccessMethodName()));
33          }
34          return options;
35      }
36  }