1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.gl.businessobject;
18
19 import java.util.LinkedHashMap;
20
21 import org.kuali.ole.coa.businessobject.Chart;
22 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23
24
25
26
27
28 public class SufficientFundRebuild extends PersistableBusinessObjectBase {
29
30 public static final String REBUILD_ACCOUNT = "A";
31 public static final String REBUILD_OBJECT = "O";
32
33 private String chartOfAccountsCode;
34 private String accountFinancialObjectTypeCode;
35 private String accountNumberFinancialObjectCode;
36 private Chart chart;
37
38
39
40
41 public SufficientFundRebuild() {
42
43 }
44
45 public SufficientFundRebuild(String line) {
46 setFromTextFile(line);
47 }
48
49
50
51
52
53
54 public void setFromTextFile(String line) {
55
56
57 line = line + " ";
58
59 setChartOfAccountsCode(line.substring(0, 2).trim());
60 setAccountFinancialObjectTypeCode(line.substring(2, 3));
61 setAccountNumberFinancialObjectCode(line.substring(3, 10).trim());
62 }
63
64
65
66
67
68 public String getLine() {
69 StringBuffer sb = new StringBuffer();
70 sb.append(getField(2, chartOfAccountsCode));
71 sb.append(getField(1, accountFinancialObjectTypeCode));
72 sb.append(getField(7, accountNumberFinancialObjectCode));
73 return sb.toString();
74 }
75
76 private static String SPACES = " ";
77
78
79
80
81
82
83
84
85 private String getField(int size, String value) {
86 if (value == null) {
87 return SPACES.substring(0, size);
88 }
89 else {
90 if (value.length() < size) {
91 return value + SPACES.substring(0, size - value.length());
92 }
93 else {
94 return value;
95 }
96 }
97 }
98
99
100
101
102
103
104 public String getChartOfAccountsCode() {
105 return chartOfAccountsCode;
106 }
107
108
109
110
111
112
113 public void setChartOfAccountsCode(String chartOfAccountsCode) {
114 this.chartOfAccountsCode = chartOfAccountsCode;
115 }
116
117
118
119
120
121
122
123 public String getAccountFinancialObjectTypeCode() {
124 return accountFinancialObjectTypeCode;
125 }
126
127
128
129
130
131
132 public void setAccountFinancialObjectTypeCode(String accountFinancialObjectTypeCode) {
133 this.accountFinancialObjectTypeCode = accountFinancialObjectTypeCode;
134 }
135
136
137
138
139
140
141
142 public String getAccountNumberFinancialObjectCode() {
143 return accountNumberFinancialObjectCode;
144 }
145
146
147
148
149
150
151 public void setAccountNumberFinancialObjectCode(String accountNumberFinancialObjectCode) {
152 this.accountNumberFinancialObjectCode = accountNumberFinancialObjectCode;
153 }
154
155
156
157
158
159
160
161 public Chart getChart() {
162 return chart;
163 }
164
165
166
167
168
169
170
171 public void setChart(Chart chart) {
172 this.chart = chart;
173 }
174
175
176
177
178 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
179 LinkedHashMap m = new LinkedHashMap();
180 m.put("chartOfAccountsCode", this.chartOfAccountsCode);
181 m.put("accountFinancialObjectTypeCode", this.accountFinancialObjectTypeCode);
182 m.put("accountNumberFinancialObjectCode", this.accountNumberFinancialObjectCode);
183 return m;
184 }
185 }