1 /*
2 * MoneyWise: Finance Application
3 * Copyright 2012-2026. Tony Washer
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17 package io.github.tonywasher.joceanus.moneywise.sheets;
18
19 import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
20 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDataSet;
21 import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePayeeInfo;
22 import io.github.tonywasher.joceanus.prometheus.data.PrometheusDataValues;
23 import io.github.tonywasher.joceanus.prometheus.sheets.PrometheusSheetDataInfo;
24
25 /**
26 * SheetDataInfo extension for PayeeInfo.
27 *
28 * @author Tony Washer
29 */
30 public final class MoneyWiseSheetPayeeInfo
31 extends PrometheusSheetDataInfo<MoneyWisePayeeInfo> {
32 /**
33 * NamedArea for PayeeInfo.
34 */
35 private static final String AREA_PAYEEINFO = MoneyWisePayeeInfo.LIST_NAME;
36
37 /**
38 * Constructor for loading a spreadsheet.
39 *
40 * @param pReader the spreadsheet reader
41 */
42 MoneyWiseSheetPayeeInfo(final MoneyWiseReader pReader) {
43 /* Call super-constructor */
44 super(pReader, AREA_PAYEEINFO);
45
46 /* Access the InfoType list */
47 final MoneyWiseDataSet myData = (MoneyWiseDataSet) pReader.getData();
48 setDataList(myData.getPayeeInfo());
49 }
50
51 /**
52 * Constructor for creating a spreadsheet.
53 *
54 * @param pWriter the spreadsheet writer
55 */
56 MoneyWiseSheetPayeeInfo(final MoneyWiseWriter pWriter) {
57 /* Call super-constructor */
58 super(pWriter, AREA_PAYEEINFO);
59
60 /* Access the InfoType list */
61 final MoneyWiseDataSet myData = (MoneyWiseDataSet) pWriter.getData();
62 setDataList(myData.getPayeeInfo());
63 }
64
65 @Override
66 public PrometheusDataValues loadSecureValues() throws OceanusException {
67 /* Build data values */
68 return getRowValues(MoneyWisePayeeInfo.OBJECT_NAME);
69 }
70 }