Package org.apache.poi.ss.formula
Enum DataValidationEvaluator.ValidationEnum
- java.lang.Object
-
- java.lang.Enum<DataValidationEvaluator.ValidationEnum>
-
- org.apache.poi.ss.formula.DataValidationEvaluator.ValidationEnum
-
- All Implemented Interfaces:
Serializable
,Comparable<DataValidationEvaluator.ValidationEnum>
- 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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)
static DataValidationEvaluator.ValidationEnum
valueOf(String name)
Returns the enum constant of this type with the specified name.static DataValidationEvaluator.ValidationEnum[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANY
public static final DataValidationEvaluator.ValidationEnum ANY
-
INTEGER
public static final DataValidationEvaluator.ValidationEnum INTEGER
-
DECIMAL
public static final DataValidationEvaluator.ValidationEnum DECIMAL
-
LIST
public static final DataValidationEvaluator.ValidationEnum LIST
-
DATE
public static final DataValidationEvaluator.ValidationEnum DATE
-
TIME
public static final DataValidationEvaluator.ValidationEnum TIME
-
TEXT_LENGTH
public static final DataValidationEvaluator.ValidationEnum TEXT_LENGTH
-
FORMULA
public static final DataValidationEvaluator.ValidationEnum FORMULA
-
-
Method Detail
-
values
public static DataValidationEvaluator.ValidationEnum[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DataValidationEvaluator.ValidationEnum c : DataValidationEvaluator.ValidationEnum.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataValidationEvaluator.ValidationEnum valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
isValidValue
public boolean isValidValue(Cell cell, DataValidationEvaluator.DataValidationContext context)
-
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
public static boolean isValid(Cell cell, DataValidationEvaluator.DataValidationContext context)
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
-
-