All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ttzero.excel.entity.e3.ParserIdentifier Maven / Gradle / Ivy

/*
 * Copyright (c) 2019-2020, [email protected] All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.ttzero.excel.entity.e3;

import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Set;

/**
 * Identifier
 *
 * @author guanquan.wang at 2019-02-23 11:57
 */
public final class ParserIdentifier {
    /* 3 Formulas */
    public static final short FORMULA              = 0x0006; // 5.50


    public static final short EXTERNSHEET          = 0x0017; // 5.41
    public static final short DEFINEDNAME          = 0x0018; // 5.33
    public static final short NOTE                 = 0x001C; // 7.70
    public static final short SELECTION            = 0x001D; // 5.93
    public static final short EXTERNALNAME         = 0x0023; // 5.39
    public static final short FILEPASS             = 0x002F; // 5.43
    public static final short FONT                 = 0x0031; // 5.45
    public static final short CONTINUE             = 0x003C; // 5.21
    public static final short WINDOW1              = 0x003D; // 5.109
    public static final short BACKUP               = 0x0040; // 5.5
    public static final short PANE                 = 0x0041; // 5.75
    public static final short CODEPAGE             = 0x0042; // 5.17
    public static final short DCONREF              = 0x0051; // 5.30
    public static final short XCT                  = 0x0059; // 5.114
    public static final short CRN                  = 0x005A; // 5.23
    public static final short FILESHARING          = 0x005B; // 5.44
    public static final short WRITEACCESS          = 0x005C; // 5.112
    public static final short WRITEPROT            = 0x0086; // 5.113
    public static final short COUNTRY              = 0x008C; // 5.22
    public static final short HIDEOBJ              = 0x008D; // 5.56
    public static final short SORT                 = 0x0090; // 5.99
    public static final short PALETTE              = 0x0092; // 5.74
    public static final short SCL                  = 0x00A0; // 5.92
    public static final short MULRK                = 0x00BD; // 5.69
    public static final short MULBLANK             = 0x00BE; // 5.68
    public static final short RSTRING              = 0x00D6; // 5.89
    public static final short BOOKBOOL             = 0x00DA; // 5.9
    public static final short XF                   = 0x00E0; // 5.115
    public static final short MERGEDCELLS          = 0x00E5; // 5.67
    public static final short PHONETICPR           = 0x00EF; // 5.77
    /**
     * Shared String Table
     */
    public static final short SST                  = 0x00FC; // 5.100
    public static final short LABELSST             = 0x00FD; // 5.65
    public static final short EXTSST               = 0x00FF; // 5.42
    public static final short LABELRANGES          = 0x015F; // 5.64
    public static final short USESELFS             = 0x0160; // 5.106
    public static final short DSF                  = 0x0161; // 5.36
    public static final short EXTERNALBOOK         = 0x01AE; // 5.38

    /* 4.12 Conditional Formatting Table (BIFF8) */
    public static final short CFHEADER             = 0x01B0; // 5.15
    public static final short CFRULE               = 0x01B1; // 5.16


    public static final short DATAVALIDATIONS      = 0x01B2; // 5.27
    public static final short HYPERLINK            = 0x01B8; // 5.58
    public static final short DATAVALIDATION       = 0x01BE; // 5.26
    public static final short BLANK                = 0x0201; // 5.7
    public static final short NUMBER               = 0x0203; // 5.71
    public static final short LABEL                = 0x0204; // 5.63
    public static final short BOOLERR              = 0x0205; // 5.10
    public static final short STRING               = 0x0207; // 5.102
    public static final short ARRAY                = 0x0221; // 5.4
    public static final short DATATABLE            = 0x0236; // 5.24
    public static final short WINDOW2              = 0x023E; // 5.110
    public static final short RK                   = 0x027E; // 5.87
    public static final short STYLE                = 0x0293; // 5.103
    public static final short FORMAT               = 0x041E; // 5.49
    public static final short SHAREDFMLA           = 0x04BC; // 5.94
    public static final short QUICKTIP             = 0x0800; // 5.83
    public static final short RANGEPROTECTION      = 0x0868; // 5.84

    public static final short BOF                  = 0x0809; // 5.8
    public static final short EOF                  = 0x000A; // 5.37

    /* 4.3 Calculation Settings Block */
    public static final short UNCALCED             = 0x005E; // 5.105
    public static final short CALCCOUNT            = 0x000C; // 5.13
    public static final short CALCMODE             = 0x000D; // 5.14
    public static final short PRECISION            = 0x000E; // 5.79
    public static final short REFMODE              = 0x000F; // 5.85
    public static final short DELTA                = 0x0010; // 5.34
    public static final short ITERATION            = 0x0011; // 5.61
    public static final short DATEMODE             = 0x0022; // 5.28
    public static final short SAVERECALC           = 0x005F; // 5.90

    /* 4.4 Page Settings Block */
    public static final short HORIZONTALPAGEBREAKS = 0x001B; // 5.57
    public static final short VERTICALPAGEBREAKS   = 0x001A; // 5.108
    public static final short HEADER               = 0x0014; // 5.55
    public static final short FOOTER               = 0x0015; // 5.48
    public static final short HCENTER              = 0x0083; // 5.54
    public static final short VCENTER              = 0x0084; // 5.107
    public static final short LEFTMARGIN           = 0x0026; // 5.66
    public static final short RIGHTMARGIN          = 0x0027; // 5.86
    public static final short TOPMARGIN            = 0x0028; // 5.104
    public static final short BOTTOMMARGIN         = 0x0029; // 5.11
    public static final short PRINTHEADERS         = 0x002A; // 5.81
    public static final short PRINTGRIDLINES       = 0x002B; // 5.80
    public static final short PLS                  = 0x004D; // 5.78
    public static final short PAGESETUP            = 0x00A1; // 5.73
    public static final short BITMAP               = 0x00E9; // 5.6
    public static final short GRIDSET              = 0x0082; // 5.52
    public static final short GUTS                 = 0x0080; // 5.53

    /* 4.18 Worksheet/Workbook Protection */
    public static final short PROTECT              = 0x0012; // 5.82
    public static final short OBJECTPROTECT        = 0x0063; // 5.72
    public static final short SCENPROTECT          = 0x00DD; // 5.91
    public static final short PASSWORD             = 0x0013; // 5.76
    public static final short WINDOWPROTECT        = 0x0019; // 5.111


    /* Sheet */
    public static final short SHEET                = 0x0085; // 5.95
    public static final short SHEETPR              = 0x0081; // 5.97
    public static final short SHEETLAYOUT          = 0x0862; // 5.96
    public static final short SHEETPROTECTION      = 0x0867; // 5.98


    /* 4.7 Cell Table and Row Blocks */
    public static final short DEFAULTROWHEIGHT     = 0x0225; // 5.31
    public static final short DEFCOLWIDTH          = 0x0055; // 5.32
    public static final short COLINFO              = 0x007D; // 5.18
    public static final short DIMENSION            = 0x0200; // 5.35
    public static final short STANDARDWIDTH        = 0x0099; // 5.101
    public static final short DBCELL               = 0x00D7; // 5.29
    public static final short ROW                  = 0x0208; // 5.88
    public static final short INDEX                = 0x020B; // 5.59


    private static Set ids = new HashSet<>();

    static {
        Field[] fields = ParserIdentifier.class.getFields();
        for (Field f : fields) {
            if (f.getType() == short.class) {
                try {
                    ids.add((int) f.getShort(ParserIdentifier.class));
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    /**
     * Check the identify is accept.
     *
     * @param id the identify
     * @return true if accept
     */
    public static boolean contains(int id) {
        return ids.contains(id);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy