Interface BeanPropertyValidator<T,V>
-
- Type Parameters:
T
- the class of the beanV
- the class of the bean property
- All Known Subinterfaces:
ValidatedColumnAdapter<Bean,Value>
- All Known Implementing Classes:
UniqueValueValidator
public interface BeanPropertyValidator<T,V>
Validates a property of a bean from a list of beans of the same type. The list can be used to validate requirements such as uniqueness.- See Also:
ValidatedBeanListTableModel
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T,V>
BeanPropertyValidator<T,V>empty()
Create an validator that always returns null.static <T,V>
BeanPropertyValidator<T,V>from(Validator<V> validator)
Create a validator that returns the result of aValidator
.java.lang.String
validate(int selectedIndex, V propertyValue, java.util.List<? extends T> beans)
Validate a property of a bean from a list of beans.
-
-
-
Method Detail
-
empty
static <T,V> BeanPropertyValidator<T,V> empty()
Create an validator that always returns null.
-
from
static <T,V> BeanPropertyValidator<T,V> from(Validator<V> validator)
Create a validator that returns the result of aValidator
.- Type Parameters:
T
- the class of the beanV
- the class of the bean property- Parameters:
validator
- the delegate validator
-
validate
java.lang.String validate(int selectedIndex, V propertyValue, java.util.List<? extends T> beans)
Validate a property of a bean from a list of beans.- Parameters:
selectedIndex
- the index of the bean within the list of beanspropertyValue
- the value of the property to be validatedbeans
- the list of beans to use for validation- Returns:
- the validation error message or null if the bean property value is valid
-
-