接口 IValidation
public interface IValidation
Represents data validation for a worksheet range.
-
方法概要
修饰符和类型方法说明void
add
(ValidationType type) Adds data validation to the specified range.void
add
(ValidationType type, ValidationAlertStyle alertStyle, ValidationOperator validationOperator, Object formula1, Object formula2) Adds data validation to the specified range.void
delete()
Deletes the object.void
Generates the data validation from the json string.Gets the validation alert style.Gets the data validation error message.Gets the title of the data-validation error dialog box.Gets the value or expression associated with the conditional format or data validation.Gets the value or expression associated with the second part of a conditional format or data validation.boolean
Gets whether blank values are permitted by the data range validation.Gets the description of the Japanese input rules.boolean
Gets whether data validation displays a drop-down list that contains acceptable values.Gets the data validation input message.Gets the title of the data-validation input dialog box.Gets the operator for the conditional format or data validation.boolean
Gets whether the data validation error message will be displayed whenever the user enters invalid data.boolean
Gets whether the data validation input message is displayed whenever the user selects a cell in the data validation range.getType()
Gets the data type validation for a range.boolean
getValue()
Gets whether all the validation criteria are met (that is, if the range contains valid data).void
Sets the validation alert style.void
setErrorMessage
(String value) Sets the data validation error message.void
setErrorTitle
(String value) Sets the title of the data-validation error dialog box.void
setFormula1
(Object value) Sets the value or expression associated with the conditional format or data validation.void
setFormula2
(Object value) Sets the value or expression associated with the second part of a conditional format or data validation.void
setIgnoreBlank
(boolean value) Sets whether blank values are permitted by the data range validation.void
setIMEMode
(IMEModeType value) Sets the description of the Japanese input rules.void
setInCellDropdown
(boolean value) Sets whether data validation displays a drop-down list that contains acceptable values.void
setInputMessage
(String value) Sets the data validation input message.void
setInputTitle
(String value) Sets the title of the data-validation input dialog box.void
setOperator
(ValidationOperator value) Sets the operator for the conditional format or data validation.void
setShowError
(boolean value) Sets whether the data validation error message will be displayed whenever the user enters invalid data.void
setShowInputMessage
(boolean value) Sets whether the data validation input message is displayed whenever the user selects a cell in the data validation range.void
setType
(ValidationType value) Sets the data type validation for a range.toJson()
Generates a json string from the data validation.
-
方法详细资料
-
add
Adds data validation to the specified range.- 参数:
type
- Required ValidationType. The validation type.
-
add
void add(ValidationType type, ValidationAlertStyle alertStyle, ValidationOperator validationOperator, Object formula1, Object formula2) Adds data validation to the specified range.- 参数:
type
- Required ValidationType. The validation type.alertStyle
- Optional Object. The validation alert style.validationOperator
- Optional Object. The data validation operator.formula1
- Optional Object. The first part of the data validation equation.formula2
- Optional Object. The second part of the data validation whenOperator is Between or NotBetween (otherwise, this argument is ignored).
-
delete
void delete()Deletes the object. -
getAlertStyle
ValidationAlertStyle getAlertStyle()Gets the validation alert style. -
setAlertStyle
Sets the validation alert style. -
getErrorMessage
String getErrorMessage()Gets the data validation error message. -
setErrorMessage
Sets the data validation error message. -
getErrorTitle
String getErrorTitle()Gets the title of the data-validation error dialog box. -
setErrorTitle
Sets the title of the data-validation error dialog box. -
getFormula1
Object getFormula1()Gets the value or expression associated with the conditional format or data validation. Can be a constant value, a string value, a cell reference, or a formula. -
setFormula1
Sets the value or expression associated with the conditional format or data validation. Can be a constant value, a string value, a cell reference, or a formula. -
getFormula2
Object getFormula2()Gets the value or expression associated with the second part of a conditional format or data validation. -
setFormula2
Sets the value or expression associated with the second part of a conditional format or data validation. -
getIgnoreBlank
boolean getIgnoreBlank()Gets whether blank values are permitted by the data range validation. -
setIgnoreBlank
void setIgnoreBlank(boolean value) Sets whether blank values are permitted by the data range validation. -
getIMEMode
IMEModeType getIMEMode()Gets the description of the Japanese input rules. -
setIMEMode
Sets the description of the Japanese input rules. -
getInCellDropdown
boolean getInCellDropdown()Gets whether data validation displays a drop-down list that contains acceptable values. -
setInCellDropdown
void setInCellDropdown(boolean value) Sets whether data validation displays a drop-down list that contains acceptable values. -
getInputMessage
String getInputMessage()Gets the data validation input message. -
setInputMessage
Sets the data validation input message. -
getInputTitle
String getInputTitle()Gets the title of the data-validation input dialog box. -
setInputTitle
Sets the title of the data-validation input dialog box. -
getOperator
ValidationOperator getOperator()Gets the operator for the conditional format or data validation. -
setOperator
Sets the operator for the conditional format or data validation. -
getShowError
boolean getShowError()Gets whether the data validation error message will be displayed whenever the user enters invalid data. -
setShowError
void setShowError(boolean value) Sets whether the data validation error message will be displayed whenever the user enters invalid data. -
getShowInputMessage
boolean getShowInputMessage()Gets whether the data validation input message is displayed whenever the user selects a cell in the data validation range. -
setShowInputMessage
void setShowInputMessage(boolean value) Sets whether the data validation input message is displayed whenever the user selects a cell in the data validation range. -
getType
ValidationType getType()Gets the data type validation for a range. -
setType
Sets the data type validation for a range. -
getValue
boolean getValue()Gets whether all the validation criteria are met (that is, if the range contains valid data). -
fromJson
Generates the data validation from the json string.- 参数:
json
- the json string
-
toJson
String toJson()Generates a json string from the data validation.- 返回:
-