[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

BarcodeType

Enum Class BarcodeType

java.lang.Object
java.lang.Enum<BarcodeType>
com.grapecity.documents.excel.BarcodeType
All Implemented Interfaces:
Serializable, Comparable<BarcodeType>, Constable

public enum BarcodeType extends Enum<BarcodeType>
指定条形码的类型。

使用此枚举可识别 IBarcode 实例所表示的条形码符号体系,例如 QRCode、 DataMatrix 或 PDF417。它包括库支持的二维条形码类型和线性条形码类型。


 worksheet.getRange("A1").setFormula("=BC_QRCODE(\"https://www.example.com\")");
 IBarcode barcode = (IBarcode) worksheet.getRange("A1").getValue();
 BarcodeType type = barcode.getCodeType();
 boolean isQrCode = type == BarcodeType.QRCode;
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    指定 Codabar 条形码类型。
    Code 128 使用完整的 ASCII 字符集,并会在 Code 128 A、B 和 C 之间自动选择,以生成最小的条形码。
    指定 Code 39 条形码类型。
    Code 49 是一种二维高密度堆叠条形码。
    指定 Code 93 条形码类型。
    指定 Data Matrix 条形码类型。
    指定 EAN-13 条形码类型。
    指定 EAN-8 条形码类型。
    表示 GS1-128 条形码类型。
    指定 PDF417 条形码类型。
    QRCode 是一种二维码制,能够处理数字、字母数字和字节数据,以及日文汉字和假名字符。
  • Method Summary

    Modifier and Type
    Method
    Description
    forValue(int value)
    获取与指定整数值对应的枚举常量。
    int
    获取表示枚举常量的整数值。
    Returns the enum constant of this class with the specified name.
    static BarcodeType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • QRCode

      public static final BarcodeType QRCode
      QRCode 是一种二维码制,能够处理数字、字母数字和字节数据,以及日文汉字和假名字符。

      此条形码类型最多可编码 7,366 个字符。

    • DataMatrix

      public static final BarcodeType DataMatrix
      指定 Data Matrix 条形码类型。

      Data Matrix 是一种高密度二维条形码,由按正方形或矩形矩阵排列的黑白模块组成。

    • PDF417

      public static final BarcodeType PDF417
      指定 PDF417 条形码类型。

      PDF417 是一种常用的高密度二维码制,最多可编码 1108 字节的信息。此条形码由一组堆叠的较小条形码组成,支持完整的 ASCII 字符集,并且最多可编码 2725 个数据字符。

    • EAN8

      public static final BarcodeType EAN8
      指定 EAN-8 条形码类型。

      EAN-8 仅支持数字字符,由 7 位数据数字和 1 位校验数字组成。

    • EAN13

      public static final BarcodeType EAN13
      指定 EAN-13 条形码类型。

      EAN-13 仅使用数字字符,并编码 12 位数字加 1 位校验位。如果值只包含 12 位数字,则会自动计算第 13 位数字。如果值包含 13 位数字,则会验证校验位;如果校验位不正确,则会引发错误。

    • Code39

      public static final BarcodeType Code39
      指定 Code 39 条形码类型。

      Code 39 是一种线性条形码,使用数字字符、大写字母以及特殊字符,例如 %、 *、 $、 /、.、 - 和 +。

    • Code93

      public static final BarcodeType Code93
      指定 Code 93 条形码类型。

      Code 93 支持大写字母、数字字符以及特殊字符 %, $, *, /, ., - 和 +。它通常用于编码补充投递信息。

    • Code49

      public static final BarcodeType Code49
      Code 49 是一种二维高密度堆叠条形码。

      它用于编码完整的 ASCII 字符集。

    • Code128

      public static final BarcodeType Code128
      Code 128 使用完整的 ASCII 字符集,并会在 Code 128 A、B 和 C 之间自动选择,以生成最小的条形码。
    • Codabar

      public static final BarcodeType Codabar
      指定 Codabar 条形码类型。

      Codabar 使用字符 A, B, C, D, +, -, :, ,, / 和数字。

    • GS1_128

      public static final BarcodeType GS1_128
      表示 GS1-128 条形码类型。

      GS1-128 是 Code 128 的一种变体,支持完整的 ASCII 字符集。它在第一个字符位置使用 FNC1 字符,并通过一系列应用标识符对数据进行编码。

  • Method Details

    • values

      public static BarcodeType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BarcodeType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      获取表示枚举常量的整数值。
      Returns:
      枚举常量的序数值。
    • forValue

      public static BarcodeType forValue(int value)
      获取与指定整数值对应的枚举常量。

      使用此方法可将从 getValue() 获取的整数值转换回对应的 BarcodeType 常量。

      Parameters:
      value - 表示枚举常量的整数值。
      Returns:
      与指定值对应的 BarcodeType 枚举常量。
      Throws:
      ArrayIndexOutOfBoundsException - 如果 value 小于 0 或大于等于枚举常量的数量。