Module is.codion.swing.common.ui
Class ValidationDocumentFilter<T>
java.lang.Object
javax.swing.text.DocumentFilter
is.codion.swing.common.ui.component.text.ValidationDocumentFilter<T>
- Type Parameters:
T
- the value type
- Direct Known Subclasses:
ParsingDocumentFilter
A
DocumentFilter
extension providing validation and parsing.-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.DocumentFilter
DocumentFilter.FilterBypass
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addValidator
(Value.Validator<T> validator) Adds a validator to this validation documentprotected final void
Validates the given value using all the underlying validators (if any).final Collection<Value.Validator<T>>
Methods inherited from class javax.swing.text.DocumentFilter
insertString, remove, replace
-
Constructor Details
-
ValidationDocumentFilter
public ValidationDocumentFilter()
-
-
Method Details
-
addValidator
Adds a validator to this validation document- Parameters:
validator
- the validator to add
-
validators
- Returns:
- an unmodifiable view of the document validators
-
validate
Validates the given value using all the underlying validators (if any).- Parameters:
value
- the value to validate- Throws:
IllegalArgumentException
- in case of an invalid value- See Also:
-