Package org.apache.poi.ss.formula
Enum Class DataValidationEvaluator.ValidationEnum
java.lang.Object
java.lang.Enum<DataValidationEvaluator.ValidationEnum>
org.apache.poi.ss.formula.DataValidationEvaluator.ValidationEnum
- All Implemented Interfaces:
Serializable
,Comparable<DataValidationEvaluator.ValidationEnum>
,Constable
- Enclosing class:
- DataValidationEvaluator
public static enum DataValidationEvaluator.ValidationEnum
extends Enum<DataValidationEvaluator.ValidationEnum>
Not calling it ValidationType to avoid confusion for now with DataValidationConstraint.ValidationType.
Definition order matches OOXML type ID indexes
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isValid
(Cell cell, DataValidationEvaluator.DataValidationContext context) Validates against the type defined in context, as an index of the enum values array.protected boolean
isValidNumericCell
(Cell cell, DataValidationEvaluator.DataValidationContext context) Uses the cell value, which may be the cached formula result value.protected boolean
isValidNumericValue
(Double value, DataValidationEvaluator.DataValidationContext context) Is the number a valid option for the validation?boolean
isValidValue
(Cell cell, DataValidationEvaluator.DataValidationContext context) Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANY
-
INTEGER
-
DECIMAL
-
LIST
-
DATE
-
TIME
-
TEXT_LENGTH
-
FORMULA
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
isValidValue
-
isValidNumericCell
protected boolean isValidNumericCell(Cell cell, DataValidationEvaluator.DataValidationContext context) Uses the cell value, which may be the cached formula result value. We won't re-evaluate cells here. This validation would be after the cell value was updated externally. Excel allows invalid values through methods like copy/paste, and only validates them when the user interactively edits the cell.- Returns:
- if the cell is a valid numeric cell for the validation or not
-
isValidNumericValue
protected boolean isValidNumericValue(Double value, DataValidationEvaluator.DataValidationContext context) Is the number a valid option for the validation? -
isValid
Validates against the type defined in context, as an index of the enum values array.- Parameters:
cell
- Cell to check validity ofcontext
- The Data Validation to check against- Returns:
- true if validation passes
- Throws:
ArrayIndexOutOfBoundsException
- if the constraint type is an invalid index
-