View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.kfs.sys.businessobject.options;
20  
21  import java.util.ArrayList;
22  import java.util.Collections;
23  import java.util.List;
24  
25  import org.kuali.kfs.sys.businessobject.AccountingLineOverride;
26  import org.kuali.rice.core.api.util.ConcreteKeyValue;
27  import org.kuali.rice.core.api.util.KeyValue;
28  import org.kuali.rice.krad.keyvalues.KeyValuesBase;
29  import org.kuali.rice.krad.valuefinder.ValueFinder;
30  
31  public class AccountingLineOverrideOptionFinder extends KeyValuesBase implements ValueFinder {
32  
33      protected static List<KeyValue> LABELS = new ArrayList<KeyValue>();
34      static {
35          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.BLANK, ""));
36          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.NONE, "NONE"));
37          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.EXPIRED_ACCOUNT, "EXP_ACCT"));
38          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.NON_BUDGETED_OBJECT, "NON_BDG_OBJ"));
39          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.TRANSACTION_EXCEEDS_REMAINING_BUDGET, "TRAN_EXCD_REM_BDG"));
40          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.EXPIRED_ACCOUNT_AND_NON_BUDGETED_OBJECT, "EXP_ACCT_NON_BDG_OBJ"));
41          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.NON_BUDGETED_OBJECT_AND_TRANSACTION_EXCEEDS_REMAINING_BUDGET, "NON_BDG_OBJ_TRAN_EXCD_REM_BDG"));
42          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.EXPIRED_ACCOUNT_AND_TRANSACTION_EXCEEDS_REMAINING_BUDGET, "EXP_ACCT_TRAN_EXCD_REM_BDG"));
43          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.EXPIRED_ACCOUNT_AND_NON_BUDGETED_OBJECT_AND_TRANSACTION_EXCEEDS_REMAINING_BUDGET, "EXP_ACCT_NON_BDG_OBJ_EXCD_BDG"));
44          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.NON_FRINGE_ACCOUNT_USED, "NON_FR_ACCT"));
45          LABELS.add(new ConcreteKeyValue(AccountingLineOverride.CODE.EXPIRED_ACCOUNT_AND_NON_FRINGE_ACCOUNT_USED, "EXP_ACCT_NON_FR_ACCT"));
46          LABELS = Collections.unmodifiableList(LABELS);
47      }
48  
49  //    public static String getLabelFromComponent( Integer component ) {
50  //        return AccountingLineOverride.valueOf( Collections.singleton(component) ).getCode();
51  //    }
52  
53      @Override
54      public List<KeyValue> getKeyValues() {
55          return LABELS;
56      }
57  
58      /**
59       * @see org.kuali.rice.krad.valuefinder.ValueFinder#getValue()
60       */
61      @Override
62      public String getValue() {
63          return AccountingLineOverride.CODE.EXPIRED_ACCOUNT;
64      }
65  }