Package org.apache.poi.xssf.usermodel
Class XSSFDataValidationConstraint
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.XSSFDataValidationConstraint
-
- All Implemented Interfaces:
DataValidationConstraint
public class XSSFDataValidationConstraint extends java.lang.Object implements DataValidationConstraint
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.poi.ss.usermodel.DataValidationConstraint
DataValidationConstraint.OperatorType, DataValidationConstraint.ValidationType
-
-
Constructor Summary
Constructors Constructor Description XSSFDataValidationConstraint(int validationType, int operator, java.lang.String formula1)
XSSFDataValidationConstraint(int validationType, int operator, java.lang.String formula1, java.lang.String formula2)
This is the constructor called using the OOXML raw data.XSSFDataValidationConstraint(int validationType, java.lang.String formula1)
XSSFDataValidationConstraint(java.lang.String[] explicitListOfValues)
list literal constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getExplicitListValues()
If validation type isDataValidationConstraint.ValidationType.LIST
andformula1
was comma-separated literal values rather than a range or named range, returns list of literal values.java.lang.String
getFormula1()
java.lang.String
getFormula2()
int
getOperator()
int
getValidationType()
java.lang.String
prettyPrint()
void
setExplicitListValues(java.lang.String[] explicitListValues)
void
setFormula1(java.lang.String formula1)
Sets a formula for expression 1.void
setFormula2(java.lang.String formula2)
Sets a formula for expression 2.void
setOperator(int operator)
Sets the comparison operator for this constraintvoid
validate()
-
-
-
Constructor Detail
-
XSSFDataValidationConstraint
public XSSFDataValidationConstraint(java.lang.String[] explicitListOfValues)
list literal constructor
-
XSSFDataValidationConstraint
public XSSFDataValidationConstraint(int validationType, java.lang.String formula1)
-
XSSFDataValidationConstraint
public XSSFDataValidationConstraint(int validationType, int operator, java.lang.String formula1)
-
XSSFDataValidationConstraint
public XSSFDataValidationConstraint(int validationType, int operator, java.lang.String formula1, java.lang.String formula2)
This is the constructor called using the OOXML raw data. Excel overloads formula1 to also encode explicit value lists, so this constructor has to check for and parse that syntax.- Parameters:
validationType
-operator
-formula1
- Overloaded: formula1 or list of explicit valuesformula2
- (formula1 is a list of explicit values, this is ignored: usenull
)
-
-
Method Detail
-
getExplicitListValues
public java.lang.String[] getExplicitListValues()
Description copied from interface:DataValidationConstraint
If validation type isDataValidationConstraint.ValidationType.LIST
andformula1
was comma-separated literal values rather than a range or named range, returns list of literal values. Otherwise returnsnull
.- Specified by:
getExplicitListValues
in interfaceDataValidationConstraint
-
getFormula1
public java.lang.String getFormula1()
- Specified by:
getFormula1
in interfaceDataValidationConstraint
- Returns:
- the formula for expression 1. May be
null
-
getFormula2
public java.lang.String getFormula2()
- Specified by:
getFormula2
in interfaceDataValidationConstraint
- Returns:
- the formula for expression 2. May be
null
-
getOperator
public int getOperator()
- Specified by:
getOperator
in interfaceDataValidationConstraint
- Returns:
- the operator used for this constraint
- See Also:
DataValidationConstraint.OperatorType
-
getValidationType
public int getValidationType()
- Specified by:
getValidationType
in interfaceDataValidationConstraint
- Returns:
- data validation type of this constraint
- See Also:
DataValidationConstraint.ValidationType
-
setExplicitListValues
public void setExplicitListValues(java.lang.String[] explicitListValues)
- Specified by:
setExplicitListValues
in interfaceDataValidationConstraint
-
setFormula1
public void setFormula1(java.lang.String formula1)
Description copied from interface:DataValidationConstraint
Sets a formula for expression 1.- Specified by:
setFormula1
in interfaceDataValidationConstraint
-
setFormula2
public void setFormula2(java.lang.String formula2)
Description copied from interface:DataValidationConstraint
Sets a formula for expression 2.- Specified by:
setFormula2
in interfaceDataValidationConstraint
-
setOperator
public void setOperator(int operator)
Description copied from interface:DataValidationConstraint
Sets the comparison operator for this constraint- Specified by:
setOperator
in interfaceDataValidationConstraint
- See Also:
DataValidationConstraint.OperatorType
-
validate
public void validate()
-
prettyPrint
public java.lang.String prettyPrint()
-
-