Interface Validatable
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
BufferedValidatable,Field<T>
- All Known Implementing Classes:
AbstractField,AbstractSelect,AbstractTextField,CheckBox,ComboBox,CustomField,DateField,Form,InlineDateField,ListSelect,NativeSelect,OptionGroup,PasswordField,PopupDateField,ProgressBar,ProgressIndicator,RichTextArea,Select,Slider,Table,TextArea,TextField,Tree,TreeTable,TwinColSelect
@Deprecated public interface Validatable extends Serializable
Interface for validatable objects. Defines methods to verify if the object's value is valid or not, and to add, remove and list registered validators of the object.
- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
Validator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddValidator(Validator validator)Deprecated.Adds a new validator for this object.Collection<Validator>getValidators()Deprecated.Returns a collection of all validators currently registered for the object.booleanisInvalidAllowed()Deprecated.Checks the validabtable object accept invalid values.The default value istrue.booleanisValid()Deprecated.Tests the current value of the object against all registered validators.voidremoveAllValidators()Deprecated.Removes all validators from this object, as ifremoveValidatorwas called for each registered validator.voidremoveValidator(Validator validator)Deprecated.Removes a previously registered validator from the object.voidsetInvalidAllowed(boolean invalidValueAllowed)Deprecated.Should the validabtable object accept invalid values.voidvalidate()Deprecated.Checks the validity of the validatable.
-
-
-
Method Detail
-
addValidator
void addValidator(Validator validator)
Deprecated.Adds a new validator for this object. The validator's
Validator.validate(Object)method is activated every time the object's value needs to be verified, that is, when theisValid()method is called. This usually happens when the object's value changes.- Parameters:
validator- the new validator
-
removeValidator
void removeValidator(Validator validator)
Deprecated.Removes a previously registered validator from the object. The specified validator is removed from the object and its
validatemethod is no longer called inisValid().- Parameters:
validator- the validator to remove
-
removeAllValidators
void removeAllValidators()
Deprecated.Removes all validators from this object, as ifremoveValidatorwas called for each registered validator.
-
getValidators
Collection<Validator> getValidators()
Deprecated.Returns a collection of all validators currently registered for the object. The collection may be immutable. Calling
removeValidatorfor this Validatable while iterating over the collection may be unsafe (e.g. may throwConcurrentModificationException.)- Returns:
- A collection of validators
-
isValid
boolean isValid()
Deprecated.Tests the current value of the object against all registered validators. The registered validators are iterated and for each the
Validator.validate(Object)method is called. If any validator throws theValidator.InvalidValueExceptionthis method returnsfalse.- Returns:
trueif the registered validators concur that the value is valid,falseotherwise
-
validate
void validate() throws Validator.InvalidValueExceptionDeprecated.Checks the validity of the validatable. If the validatable is valid this method should do nothing, and if it's not valid, it should throw
Validator.InvalidValueException- Throws:
Validator.InvalidValueException- if the value is not valid
-
isInvalidAllowed
boolean isInvalidAllowed()
Deprecated.Checks the validabtable object accept invalid values.The default value is
true.
-
setInvalidAllowed
void setInvalidAllowed(boolean invalidValueAllowed) throws UnsupportedOperationExceptionDeprecated.Should the validabtable object accept invalid values. Supporting this configuration possibility is optional. By default invalid values are allowed.
- Parameters:
invalidValueAllowed-- Throws:
UnsupportedOperationException- if the setInvalidAllowed is not supported.
-
-