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

ValidationType

Enum Class ValidationType

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

public enum ValidationType extends Enum<ValidationType>
指定要应用于单元格值的数据验证测试类型。

将此枚举与数据验证 API 一起使用,以控制单元格或区域中接受哪些类型的值。支持的验证类型包括无限制、整数、小数、列表、日期、时间、文本长度和自定义公式。


 worksheet.getRange("D2:E5").getValidation().add(
     ValidationType.Whole,
     ValidationAlertStyle.Stop,
     ValidationOperator.Between,
     3,
     8);
 
  • 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
    指定数据验证使用自定义公式来检查单元格值。
    指定数据验证检查并允许符合给定条件的日期值。
    指定数据验证检查并允许满足给定条件的十进制值。
    指定数据验证检查并允许与值列表中的一个匹配的值。
    指定数据验证允许任何类型的值,并不检查值类型或范围。
    指定数据验证检查并允许长度满足给定条件的文本值。
    指定数据验证检查并允许满足给定条件的时间值。
    指定数据验证检查并允许满足给定条件的整数价值。
  • Method Summary

    Modifier and Type
    Method
    Description
    forValue(int value)
     
    int
     
    Returns the enum constant of this class with the specified name.
    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

    • None

      public static final ValidationType None
      指定数据验证允许任何类型的值,并不检查值类型或范围。
    • Whole

      public static final ValidationType Whole
      指定数据验证检查并允许满足给定条件的整数价值。
    • Decimal

      public static final ValidationType Decimal
      指定数据验证检查并允许满足给定条件的十进制值。
    • List

      public static final ValidationType List
      指定数据验证检查并允许与值列表中的一个匹配的值。
    • Date

      public static final ValidationType Date
      指定数据验证检查并允许符合给定条件的日期值。
    • Time

      public static final ValidationType Time
      指定数据验证检查并允许满足给定条件的时间值。
    • TextLength

      public static final ValidationType TextLength
      指定数据验证检查并允许长度满足给定条件的文本值。
    • Custom

      public static final ValidationType Custom
      指定数据验证使用自定义公式来检查单元格值。
  • Method Details

    • values

      public static ValidationType[] 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 ValidationType 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()
    • forValue

      public static ValidationType forValue(int value)