Interface BeanPropertyValidator<T,​V>

  • Type Parameters:
    T - the class of the bean
    V - 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 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 a Validator.
        Type Parameters:
        T - the class of the bean
        V - 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 beans
        propertyValue - the value of the property to be validated
        beans - the list of beans to use for validation
        Returns:
        the validation error message or null if the bean property value is valid