View Javadoc
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.statics.MoneyWiseTaxBasis;
22  import io.github.tonywasher.joceanus.prometheus.data.PrometheusDataValues;
23  import io.github.tonywasher.joceanus.prometheus.sheets.PrometheusSheetStaticData;
24  
25  /**
26   * SheetStaticData extension for TaxBasis.
27   *
28   * @author Tony Washer
29   */
30  public final class MoneyWiseSheetTaxBasis
31          extends PrometheusSheetStaticData<MoneyWiseTaxBasis> {
32      /**
33       * NamedArea for Tax Bases.
34       */
35      private static final String AREA_TAXBASES = MoneyWiseTaxBasis.LIST_NAME;
36  
37      /**
38       * Constructor for loading a spreadsheet.
39       *
40       * @param pReader the spreadsheet reader
41       */
42      MoneyWiseSheetTaxBasis(final MoneyWiseReader pReader) {
43          /* Call super-constructor */
44          super(pReader, AREA_TAXBASES);
45  
46          /* Access the Tax Basis list */
47          final MoneyWiseDataSet myData = (MoneyWiseDataSet) pReader.getData();
48          setDataList(myData.getTaxBases());
49      }
50  
51      /**
52       * Constructor for creating a spreadsheet.
53       *
54       * @param pWriter the spreadsheet writer
55       */
56      MoneyWiseSheetTaxBasis(final MoneyWiseWriter pWriter) {
57          /* Call super-constructor */
58          super(pWriter, AREA_TAXBASES);
59  
60          /* Access the Tax Basis list */
61          final MoneyWiseDataSet myData = (MoneyWiseDataSet) pWriter.getData();
62          setDataList(myData.getTaxBases());
63      }
64  
65      @Override
66      public PrometheusDataValues loadSecureValues() throws OceanusException {
67          /* Build data values */
68          return getRowValues(MoneyWiseTaxBasis.OBJECT_NAME);
69      }
70  }