⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reportproperties.java

📁 信息发布 发布系统 动态的菜单 和 信息统计
💻 JAVA
字号:
package com.xuntian.material.report;

import com.xuntian.material.util.Constants;
import com.xuntian.material.util.ParseProperties;

public final class ReportProperties {
    private static ParseProperties properties;

    private static ReportProperties report = new ReportProperties();

    public static ReportProperties getInstance() {
        return report;
    }

    private ReportProperties() {
        properties = new ParseProperties(Constants.PATH_REPORT);
    }

    // common
    public int getFontSizeTitle() {
        return properties.getInt("report.font.size.title");
    }

    public int getFontSizeheader() {
        return properties.getInt("report.font.size.header");
    }

    public int getFontSizeData() {
        return properties.getInt("report.font.size.data");
    }

    public int getFontBoldWeight() {
        return properties.getInt("report.font.bold.weight");
    }

    // report
    public String[] getTitle(String report) {
        return getArray(report + ".title");
    }

    public String[][] getHeadCells(String report) {
        return get(report + ".head.cells");
    }

    public String[][] getHeadTitles(String report) {
        return get(report + ".head.titles");
    }

    public String[][] getHeadValues(String report) {
        return get(report + ".head.values");
    }

    public String[] getTitlesTable(String report) {
        return getArray(report + ".titles.table");
    }

    public String[] getDataAlign(String report) {
        return getArray(report + ".data.align");
    }

    public String[][] getFootCells(String report) {
        return get(report + ".foot.cells");
    }

    public String[][] getFootTitles(String report) {
        return get(report + ".foot.titles");
    }

    public String[][] getFootValues(String report) {
        return get(report + ".foot.values");
    }

    private String[] getArray(String key) {
        String values = properties.getString(key);
        if (values == null || values.equals("")) {
            return new String[0];
        }
        return values.split(",");
    }

    private String[][] get(String key) {
        String values = properties.getString(key);
        if (values == null || values.equals("")) {
            return new String[0][0];
        }
        String[] array = values.split("\\|");
        String[][] arrays = new String[array.length][];
        for (int i = 0; i < array.length; i++) {
            arrays[i] = array[i].split(",");
        }
        return arrays;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -